Click to See Complete Forum and Search --> : simple error


AConnorABBCO
07-27-2005, 03:12 PM
I keep getting an error on this script and I don't know why.

function countdown(){
document.clear();
document.writeln("Checked for update at " + time + "<br>Next update in " + count + " seconds.");
count--;
self.setTimeout("countdown();",1000);
}

I call it and it runs through once, runs through a 2nd time, except the text moves down a line, and then it gives me an "Object required" error.

Any help?

A1ien51
07-27-2005, 03:40 PM
You can not use document.write like that. When you use document.write it replaces the content of the page. You should look at adding a span to the page and using innerHTML to change the text.

Eric