I saw that this question has already been asked previously, but I was not sure of a solution to my problem.
I have the following code:
function mouseup ( )
{
for( i = 0; i < 6; i++ )
{
setTimeout(function(){
alert( "test" );
},1000);
}
}
But when I run the code, after a one second pause, the dialog box comes up (as it should), but when I click OK on that dialog box, the second immediately comes up, without any delay.
Is there an easy way to fix this without changing too much of the code? The reason I ask is because I am building a converter that changes code such as:
repeat 6 times
wait for 1 second
answer "test"
end repeat
into the JavaScript code above, and do not want to change too much of my converter program if I do not have too.
Many thanks in advance.
Edit: (and if you are wondering, the non-JavaScript code is HyperTalk/xTalk code)