Sunday, September 14, 2008

The SetTimeout Function

So, you want to set things to happen after a certain amount of time? Well, the setTimeout function can help you create some nice scripts that will use time delays to make things happen. Let's take a look at how to call the setTimeout function:

setTimeout("yourfunction()",1000);

The first parameter is a string, which is going to be the function you want to use. This function was named "myfunction()". The second parameter is a number. This number is going to be the number of milliseconds the browser should wait before executing your function. Above, we have 1000 milliseconds, which will be 1 second.

Ex :--

  





Now, how did I get that text to change a second time while you were able to just watch? Let's look at the script for this trick: at following site



--------------------------------------------------------------------------------

http://www.pageresource.com/jscript/jtimeout.htm