Friday, January 30, 2009
by
ASP.NET AJAX Team
|
Go comment!
This article is taken from W3Schools.
With JavaScript, it is possible to execute some code NOT immediately after a function is called, but after a specified time interval. This is called timing events.
It's very easy to time events in JavaScript. The two key methods that are used are:
- setTimeout() - executes a code some time in the future
- clearTimeout() - cancels the setTimeout()
setTimeout()
Syntax
| var t=setTimeout("javascript statement",milliseconds); |
The setTimeout() method returns a value - In the statement above, the value is stored in a variable called t. If you want to cancel this setTimeout(), you can refer to it using the variable name.
The first parameter of setTimeout() is a...