Tthis code works in all previous versions of browsers
Pause code by alert
var n = 1; alert(n); n = 5; alert(n);
Set timeout
var n = 5; // wait 5 second / do next code // next code put into function and call this function by setTimeout setTimeout("nextCodeFc (n)",5000); // wait for 5000 millisecond == 5 second and execute // how put string as parameter into setTimeout var str = "Hello string parameter!"; setTimeout("nextCodeFc(\"str"\)",3000); // produce "str" setTimeout("nextCodeFc(\""+str+"\")",3000); // produce "Hello string parameter!" setTimeout("nextCodeFc(str)",3000); // produce Hello string parameter! function nextCodeFc (n){ // do work ......... alert(n); }