There is really no effective way to pause a script in javascript. But let me suggest one:
function pausecomp(millis){
var date = new Date();
var curDate = null;
do{
curDate = new Date();
}while(curDate-date < millis);
}
So this will stop the whole script for a few milliseconds. However, this is not a good practice.
Javascript allows you to set events after a delay:
setTimeout("alert('hello')",1250);
So, when this line of code is reached, the setTimeout method raises a warning when 1250 milliseconds are passed.
, ;)
, , jsfiddle: http://jsfiddle.net/xPAwu/1/
, stackoverflow: , ?
Javascript,