About 50 results
Open links in new tab
  1. Wait 5 seconds before executing next line - Stack Overflow

    This function below doesn’t work like I want it to; being a JS novice I can’t figure out why. I need it to wait 5 seconds before checking whether the newState is -1. Currently, it doesn’t wait, i...

  2. jquery - JavaScript sleep/wait before continuing - Stack Overflow

    JavaScript sleep/wait before continuing [duplicate] Asked 12 years, 8 months ago Modified 5 years, 7 months ago Viewed 1.5m times

  3. Sleep in JavaScript - delay between actions - Stack Overflow

    Can I sleep in JavaScript before carrying out another action? var a = 1; // Sleep 3 seconds before the next action here. var b = 4;

  4. Is there a sleep function in JavaScript? - Stack Overflow

    Jul 17, 2009 · If you run the above function, you will have to wait for 3 seconds (sleep method call is blocking) before you see the alert 'hi'. Unfortunately, there is no sleep function like that in JavaScript.

  5. Put a Delay in Javascript - Stack Overflow

    Jul 26, 2009 · I need to add a delay of about 100 miliseconds to my Javascript code but I don't want to use the setTimeout function of the window object and I don't want to use a busy loop.

  6. Javascript sleep/delay/wait function - Stack Overflow

    I want to create a JavaScript sleep/delay/wait function that I can call anywhere in the script, like jQuery's .delay() I am not able to use setTimeout, as I have a script that is generated by php, ...

  7. How do I add a delay in a JavaScript loop? - Stack Overflow

    Aug 27, 2010 · This disregards the ask to have a delay inside a loop. Is simply set series of events on 5 seconds interval (might as well use setInterval). To better understand the problem, use alert and wait …

  8. javascript - How to wait for a period of time after a function run ...

    Apr 29, 2015 · Take the date value first and use setInterval function to wait until we get specified interval (get new Date and check for difference). Once we get that reset the interval function and proceed …

  9. What is the JavaScript version of sleep ()? - Stack Overflow

    Jun 4, 2009 · The issue here is that JavaScript is a single-thread event-based model. While in a specific case, it might be nice to have the whole engine wait for a few seconds, in general it is bad practice. …

  10. Javascript wait () function - Stack Overflow

    Mar 29, 2013 · Javascript isn't threaded, so a "wait" would freeze the entire page (and probably cause the browser to stop running the script entirely). To specifically address your problem, you should …