Refresh Page for interval using js Refresh Page for interval using js javascript javascript

Refresh Page for interval using js


Just insert this code anywhere in the page:

<script type="text/javascript">  setTimeout(function(){    location = ''  },60000)</script>


<script type="text/javascript">    setTimeout(function () {       location.reload();    }, 60 * 1000);</script>

setTimeout will reload the page after a specified number of milliseconds, hence 60 * 1000 = 1m. Also, since the page is being refreshed, the timeout will always be set on page load.


You do not need to have the code in the body tag. Just add this snippet below and it should work no matter where it is in the page.

<script type="text/javascript">    setInterval('window.location.reload()', 60000);</script>

As long as you can access the HTML some where and your editor doesn't filter out tags you should be fine. If your editor has a separate area for JavaScript code then just enter setInterval line. :)