![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I want to take the script out of the page and have it as a seperate file that can be cached, reducing serving costs - the page gets hit a couple of thousand times per day, sometimes as high a 5K, so any savings are multiplied. |
|
function countdown() { if (sec==0 && min>0) { sec=59; min--; } else { sec--; } msg = '<b>Next Tick: ' + min + ':' + ((sec < 10) ? '0' : '') + sec + '</b>'; if (document.all) document.all.tel.innerHTML = msg; else if (document.getElementById('tel')) document.getElementById('tel').innerHTML = msg; if (sec==0 && min==0) { min=60; sec=00; } if (sec>0 || min>0) setTimeout('countdown()',1000); } |
|
var min=40; var sec=40; window.onload=countdown; |
![]() |
| Thread Tools | |
| Display Modes | |
| |