D
Denebola
I am trying to refresh my webpage every minute, on the minute and so
far have the script below in the <head> of my page:
<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
var now = new Date();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
setTimeout('refresh()',(((((seconds>0)?1:0)) * 60) + (60 -
seconds)) * 1000);
}
function refresh() {
window.location.href = 'http://www.bbc.co.uk';
}
startTimer();
//--></SCRIPT>
The problem is that if i visit this page at say 25 seconds past the
minute, it won't refresh at the next minute change (in 35 seconds) but
will wait til the next minute to do so (i.e. in 95 seconds).
Where am I going wrong......??
Regards
far have the script below in the <head> of my page:
<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
var now = new Date();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
setTimeout('refresh()',(((((seconds>0)?1:0)) * 60) + (60 -
seconds)) * 1000);
}
function refresh() {
window.location.href = 'http://www.bbc.co.uk';
}
startTimer();
//--></SCRIPT>
The problem is that if i visit this page at say 25 seconds past the
minute, it won't refresh at the next minute change (in 35 seconds) but
will wait til the next minute to do so (i.e. in 95 seconds).
Where am I going wrong......??
Regards