Changes

Jump to: navigation, search

JavaScript Timeouts

31 bytes added, 14:55, 19 March 2009
Setting up JavaScript Timeout to Repeat
== Setting up JavaScript Timeout to Repeat ==
<google>ADSDAQBOX_FLOW</google>
You may have noticed that there is no argument to the ''setTimeout()'' method to tell JavaScript to repeat the timeout once it has expired. If, once the timeout has triggered, you need to run the timeout again all you need to do is make another call to ''setTimeout()'' within the function that was called when the timeout was triggered. We can see this in action by extending our original example. In the example below a function we have named ''timedout()'' is called after 10000 milliseconds. After the alert dialog is dismissed by the user the timeout is set up again so that the process will repeat:

Navigation menu