How to do autorefresh using javascript

  1. If you want to refresh your page automatically after loading the page
    <script type="text/JavaScript">
    function timedRefresh(timeoutPeriod) {

    <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.
  2. If you want to refresh a page "on click", type the following code as:-

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


Post a Comment

Popular posts from this blog

How to fix 500 internal privoxy error

jQuery & JavaScript PDF Viewer plugin

ubuntu package installation