Forum Moderators: open

Message Too Old, No Replies

Countdown Freezing

I have a javascript countdown that randomly freezes

         

xxclixxx

2:04 pm on Nov 28, 2007 (gmt 0)

10+ Year Member



Hi

I have a page that has a countdown timer, and an iframe. An advertisement loads in the iframe and after the timer is down you can go on.

However, some sites seem to be freezing the timer. Using the error console in Firefox, it's usually some kind of error on the website being viewed.

Is there a way to make the timer work, even if the site in the iframe flips out? When I was using normal frames this didn't happen..

Thanks!

xxclixxx

2:10 pm on Nov 28, 2007 (gmt 0)

10+ Year Member



 var fronttext='<font face=verdana>';
var backtext='</font>';
function countdown(number) {
document.getElementById("count").innerHTML=fronttext + number + backtext;
if (document.formname) {
document.formname.ta.value = (10 - number);
}
var next = number - 1;
if (next >= 0) { setTimeout("countdown('" + next + "')",1000); }
else { switchdiv(); }
}