How to auto refresh a page through JavaScript?

Here is the small JavaScript example that tells how you can use setTimeout() to auto refresh page content. You can utilize this script in games site or stock sites or anywhere you can think of.




PHPMIND โ€“ Javascript Tutorials



JavaScript Auto Refresh Page

This code will refresh you page in 6 seconds. We have used OnLoad() Event function to call our function. Note : Please donโ€™t use a lot of auto refresh page because it is kind of annoying and your sever bandwidth will be decreasing, one way you are increasing hits to server.

Share

3 thoughts on “How to auto refresh a page through JavaScript?

  1. Nil

    thanks. i’m any changed for funcybox. ๐Ÿ˜‰

    function refresh(nw,sn){ if(nw != ‘0’){clearTimeout(v);} v=setTimeout(“location.reload(true);”,(sn*1000));}

    funcybox function in

    afterLoad : function() {refresh(1,360);},
    afterClose : function() {refresh(1,60);}

Leave a Reply

Your email address will not be published. Required fields are marked *