We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Auto Page Refresh ( The best and only option at this point ) | Forum

MarkieMark67
MarkieMark67 Jun 11 '14
Here is a simple way to refresh a page with little knowledge of programming needed.


<script>

    var time = new Date().getTime();

    var refreshTime = 6*1000;


    $(document).bind("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error hover change", function(e) {

    time = new Date().getTime(); });


    function refresh()

    {

       if(new Date().getTime() - time >= refreshTime)

           window.location.reload(true);

       else

    setTimeout(refresh, refreshTime);    

      }

  

     setTimeout(refresh, refreshTime);


</script>



Current code is set for 6 sec...



In admin/settings/page


Add this little script to CUSTOM HEAD CODE.


Yes it does refresh the whole page but it will cancel /  Reset when many commands are done. Example : If the mouse is moved or a key is pressed it'll reset the trimer... 



 

The Forum post is edited by MarkieMark67 Jun 17 '14