I’m pretty sure timeout() is the equivalent of Perl’s sleep(). It’s a dedicated function built into the API so is likely be the most efficient solution.
Joe
On 27 Feb 2010, at 18:51, tobiaseichner wrote:
For a small JavaScript app I look for a way to interrupt code execution a few seconds till proceeding. For example:
...
document.forms[0].elements["result"].value = "Anything is okay. Proceeding";
return true;
Between these two commands the script should wait two seconds giving the user the chance to read the text.
I thought about adding a timeout, but maybe there is a more elegant solution (like “sleep” in Perl) ?
But even after having a close look at my reference books, I haven’t found something.