i am using javascript for loop, to loop through a particular array and alert it’s value. I want that after every alert it should stop for 30 seconds and then continue…till the end of loop.
my code goes here..
for(var i=0; i<valArray.lenght; i++)
{
alert("The value ="+valArray[i]);
//stop for 30seconds..
}
i have used setTimeout() function, but it is not working…as loop end iterating but do not pause for 30seconds interval…
is there any other way such as sleep function in PHP??
Edited to fix the closure loop problem.