Tuesday 19 February 2013

Refresh Page/Browser Automatically after a Particular Time Period V


Refresh Page/Browser Automatically after a Particular Time Period V


If you want to refresh a web page using a mouse click then you can use following code:


<a href="javascript:location.reload(true)">Refresh Page</a>

You can also use JavaScript to refresh the page automatically after a given time period. Following is the example which would refresh this page after every 5 seconds. You can change this time as per your requirement.


<html>
<head>
<script type="text/JavaScript">
<!--
function AutoRefresh( t ) {
 setTimeout("location.reload(true);", t);
}
//   -->
</script>
</head>
<body onload="JavaScript:AutoRefresh(5000);">
<p>This page will refresh every 5 seconds.</p>
</body>
</html>

No comments:

Post a Comment

Thank You for Your Comments. We will get back to you soon.

back to top