User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 360,997 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,451 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Is there a sleep/wait javascript function for firefox?

Join Date: May 2005
Location: Wellington, New Zealand
Posts: 182
Reputation: alpha_foobar is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 3
alpha_foobar's Avatar
alpha_foobar alpha_foobar is offline Offline
Junior Poster

Re: Is there a sleep/wait javascript function for firefox?

  #3  
Jun 6th, 2006
What you usually do is what Tom has suggested, but you would invoke a call to the code that you want to execute after timeout.

So if you had an algorithm like such:

function myFunction(){
   doSomething();
   wait(500);
   doSomethingElse();
}

You would implement this with:

function myFunction(){
   doSomething();
   setTimeout(function(){doSomethingElse();}, 500);
}

This effective 'pauses' the execution of your code.
Reply With Quote  
All times are GMT -4. The time now is 6:55 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC