Colin,
Thanks for your feedback. I've modified the test1() as follows:
function test1() {
var msg;
msg=Math.random();
document.write (msg + "<BR>");
window.clearTimeout(s);
s=window.setTimeout("test1();",1000);
}
Unfortunately, it gives the error in the inserted line: "s is not defined".
OOPS! It seems to me that I've found the reason. Document.write refreshes
the window, so definitely neither "s" nor "test1" is visible!
After I set the output to a text box, everything got fine.
Happy New Year!
Lev
> Hey
I think that in test() you should clear the timeout.
if you set something for 1000ms in test1, with the timeout still being 's',
then the 1000ms will already have happened. i'm not too sure though. (i'm a
bit pushed for time, so i can't check it and stuff)
Colin