Alex Rivera | Logout

Refresh Page for interval using js

Asked 2012-08-20T13:00:28.360
24

How can i refresh a page for every one minute using javascript. Note: I don't have control/option to edit HTML body tag (where we usually call onload function).

Edit
Report

1 Answer

13

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. :)

answered 2012-08-20T13:06:39.397

Your Answer