Refreshing a page after certain delay in jquery

This question already has an answer here:

  • How to schedule IE page reload 4 answers

  • You don't even need jQuery or HTML5 for this:

    setTimeout(location.reload.bind(location), 60000);
    

    This will wait 1 minute (60,000 milliseconds), then call the location.reload function, which is a built-in function to refresh the page.


    setTimeout(function(){
        location.reload();
    },delayTime); //delayTime should be written in milliseconds e.g. 1000 which equals 1 second
    

    You may try this without js , it cycles:

    <meta http-equiv="refresh" content="5"/> <!-- 5 sec interval-->
    <h1>Page refersh in every 5 seconds...</h1>
    

    You can even navigate to a different page, visiting google home page

    <meta http-equiv="refresh" content="5;http://www.google.com"/> <!-- 5 sec delay-->
    <h1>Redirecting in 5 seconds...</h1>
    
    链接地址: http://www.djcxy.com/p/28682.html

    上一篇: 浏览器支持window.location.reload(true)

    下一篇: 在jQuery中存在一定的延迟后刷新页面