What is the best way to pause in JavaScript. I have attempted to use the setTimeout() function before, but I really got confused on how it works.
var pauseTime = 1000; //this is in milliseconds
setTimeout(runThisFunction,pauseTime);
function runThisFunction(){
alert("i waited a second to run!");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.