Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-24-2002, 06:17 AM   PM User | #1
saldikey
New Coder

 
Join Date: Jun 2002
Location: WI - is not only cows and beer
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
saldikey is an unknown quantity at this point
Making loop to stop for a while

Hi!
Is it possible to make loop wait on each step?

I tried to use setTimeout - its not working
I tried to use break - its let me do loop only once, than I made it nested loop - no visible pause

Please, I just dont wanna give up.
__________________
"Intelegence complicates.
Wisdom simplifies."
Mason Cooley
saldikey is offline   Reply With Quote
Old 06-24-2002, 02:27 PM   PM User | #2
saldikey
New Coder

 
Join Date: Jun 2002
Location: WI - is not only cows and beer
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
saldikey is an unknown quantity at this point
for (condition)
{
document.write(Something)
/*I want it make stop here*/
}


Thank you
__________________
"Intelegence complicates.
Wisdom simplifies."
Mason Cooley
saldikey is offline   Reply With Quote
Old 06-24-2002, 04:08 PM   PM User | #3
nolachrymose
Regular Coder

 
Join Date: Jun 2002
Posts: 338
Thanks: 0
Thanked 0 Times in 0 Posts
nolachrymose is an unknown quantity at this point
Code:
var interval=setInterval(writeStuff,1500);
var i=0;
var thingsToWrite=["hello","how are you?","fine","you?","fine","good","bye"]; //it's a time like this I wish there was the qw "thingy" in JS!

function writeStuff() {
document.writeln(thingsToWrite[i]+"<br/>");
i++;
if(i==thingsToWrite.length) 
clearInterval(interval);
}
Hope that helps!

Happy coding!
nolachrymose is offline   Reply With Quote
Old 06-24-2002, 04:26 PM   PM User | #4
tamienne
Regular Coder

 
Join Date: Jun 2002
Location: Delaware, USA
Posts: 138
Thanks: 0
Thanked 0 Times in 0 Posts
tamienne is an unknown quantity at this point
This gives a pretty good explanation.


http://www.faqts.com/knowledge_base/...d/1602/fid/143
tamienne is offline   Reply With Quote
Old 06-24-2002, 07:24 PM   PM User | #5
saldikey
New Coder

 
Join Date: Jun 2002
Location: WI - is not only cows and beer
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
saldikey is an unknown quantity at this point
Thumbs up Thank you

It works now, but only at IE
not NS, but I will do something about it

You can take a look at this "stop" here:
http://fatweb.info
__________________
"Intelegence complicates.
Wisdom simplifies."
Mason Cooley
saldikey is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:50 AM.


Advertisement
Log in to turn off these ads.