Monday, February 21, 2011

Two way to refresh the page using javascript

1. Using link.
<a href="javascript:location.reload(true)">Refresh </a>
it will show link "Refresh" on page by clicking, it will refresh the page




2. Automatic refreshing  of page using javascript
<html>

<head>
<script type="text/JavaScript">
function timedRefresh(timeoutPeriod) {
    setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>
<body onload="JavaScript:timedRefresh(5000);">
</body>
</html>

it will refresh page every 5 sec when page is loaded

No comments:

Post a Comment