In Javascript, you could schedule a function call using the setTimeout().
<html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script> <script type="text/javascript"> $(document).ready(function() { setTimeout(delayedAlert, 3000); }); function delayedAlert() { alert("Hello Eureka!"); } </script> </head> <body> <h1>Eureka!</h1> </body> </html>
The alert box will be shown in 3 seconds after the page is loaded.
Done =)
Next suggested post: Javascript – Passing Parameters for the Function in setTimeout()
Good example…
You can also read in detailed about setTimeout and it’s various type of usage in jQuery.
http://jquerybyexample.blogspot.com/2012/02/how-to-use-jquery-settimeout-function.html
LikeLike