Thursday 1 November 2012

How Refresh Web Page With Javascript and Jquery

There is many way to refresh the page with javascript and jquery and also you can set timing for refreshing the page, these details are giving below.

1. Javascript refresh the page

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

2. Auto refresh the page with javascript

   
<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>

3. Jquery using refresh the page

    $('#something').click(function() {
    location.reload();
});                               
4. In Html tag
  <input type="button" value="Reload Page" onClick="document.location.reload(true)">                     

These are the method using for page refresh.                         

No comments:

Post a Comment