I am migrate a home site from Windows to Linux Debian and Nginx.The HTML code was working under Windows.
Here the part of the HTML code, where I try to call a Javescript function, which is included in mairlist.js.
The second call I have only implemented for debugging reasons.
</div>
<script type="application/javascript">setProgress({Setup.cTime}, {Setup.duration});</script>
<script type="text/javascript" language="javascript">setProg({Setup.cTime}, {Setup.duration});</script>
</div>
And here is are the Javascript functions i mairlist.js
function setProg(cTime, tTime){
ctime++;
};
function setProgress(cTime, tTime) {
var id = setInterval(prog, 1000);
var width = 0;
function prog() {
cTime++;
if(cTime > tTime){
cTime = tTime;
}
var tNew = $("#sDur").val();
if(tNew != tTime){
tTime = tNew;
cTime = $("#cTime").val();
}
width=cTime/tTime*100;
$("#slider").val(width);
var cMin = Math.floor(cTime / 60);
var cSec = Math.floor(cTime % 60);
var tMin = Math.floor(tTime / 60);
var tSec = Math.floor(tTime % 60);
var txt = (cMin < 10 ? '0' +cMin : cMin) + ':' + (cSec < 10 ? '0' +cSec : cSec) + ' / ' + (tMin < 10 ? '0' +tMin : tMin) + ':' + (tSec < 10 ? '0' +tSec : tSec);
$('#pTime').html(txt);
}
};
And here the message from FF browser. Chrome shows a simular one.
I thing that the calls in the HTML code are correct, because the browsers try to find the function.
I also can see, that the browser has successful loaded mairlist.js.
But what is wrong with the code in mairlist.js?
mairlist.js. Only thefunction setProgis included. Still the same error! The Javascript file stands just before</body>. So I think it nothing to do with the Javascript code!<script>tags. They are not necessary unless you are trying to make the browser ignore a<script>. For normal JavaScript those attributes have not been necessary for a really long time.