Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
124
rated 0 times [  127] [ 3]  / answers: 1 / hits: 24502  / 10 Years ago, sat, august 9, 2014, 12:00:00

I want to do this



statement1;
// rest for 0.5 seconds
statement2;


How can I make my JavaScript wait 0.5 seconds?



I tried



statement1;
window.setTimer(500);
statement2;


But that was not it. Thanks


More From » javascript

 Answers
25
statement1();
setTimeout(function() {
statement2();
}, 500);

[#69844] Thursday, August 7, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarod

Total Points: 62
Total Questions: 111
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
jarod questions
;