Posts

Showing posts from November 20, 2009

How to do autorefresh using javascript

If you want to refresh your page automatically after loading the page <html> < head> < script type="text/JavaScript"> function timedRefresh(timeoutPeriod) { setTimeout("location.reload(true);",timeoutPeriod); } < /script> < /head> < body onload="JavaScript:timedRefresh(5000);"> This page will refresh every 5 seconds. Here we are using the "onload" event to call our function. We are passing in the value '5000', which equals 5 seconds. < /body> < /html > I f you want to refresh a page " on click ", type the following code as:- < a href="javascript:location.reload(true)" > Refresh this page < /a >