|
Heheh
This is a clever little problem.
Here is what is happening.
Page loads, calls testingThis() In 2 seconds, it calls runMe() It uses the document.write() function This clears all data on the page, including the script you are trying to run.
Object not found. You need to do something other than write to the page that is running the script. Usually if you want to use document.open() or document.write() you write to a different frame. top.frameName.document.write() . . etc.
–You can have multiple setTimeout() statements on a page, even if it creates an infinite loop, as long as there is enough time between iterations for other processes to run – it won’t lock up the browser. This is how those little _javascript_ timers and clocks are created! =)
ex: var countdown = 5; function liftoffCountdown(){ if(countdown <= 0){ alert(countdown); countdown--; setTimeout(‘liftoffCountdown()’,1000); }else{ alert(‘liftoff!’) } } liftoffCountdown();
this would alert ‘5’ ‘4’ ‘3’ ‘2’ ‘1’ ‘liftoff!’. You could change the countdown to 500000 and it wouldn’t lock the browser (just make sure you can close the browser in that 1 second gap between alerts! Lol. (just an example people)
Best Regards,
Nate Nielsen [EMAIL PROTECTED]
-----Original Message-----
Looks like SetTimeout Can only run once on a page...I took out the SetTimeOut and it creates an infinite loop. Not sure the purpose of creating this loop, but SetTimeout running multiple times is your issue.
|
Title: Message
- CF and Javascript Ron Mast
- RE: CF and Javascript Dan Blackman
- RE: CF and Javascript Nate Nielsen
- RE: CF and Javascript Ferguson, Ken
- RE: CF and Javascript Ferguson, Ken
- RE: CF and Javascript Ron Mast
- RE: CF and Javascript S . Isaac Dealey
- RE: CF and Javascript S . Isaac Dealey
- RE: CF and Javascript Ron Mast
- RE: CF and Javascript S . Isaac Dealey
- RE: CF and Javascript Ron Mast
- RE: CF and Javascript Jacob Cameron
- RE: CF and Javascript Ron Mast
