使用JavaScript或HTML刷新页面

这个问题在这里已经有了答案:

  • 如何使用JavaScript重新加载页面? 16个答案

  • window.location.reload(); 在JavaScript中

    HTML中的<meta http-equiv="refresh" content="1"> (其中1 = 1秒)。


    这里有535种方式使用javascript重新加载页面,非常酷:

    这里是第20个:

    location = location
    location = location.href
    location = window.location
    location = self.location
    location = window.location.href
    location = self.location.href
    location = location['href']
    location = window['location']
    location = window['location'].href
    location = window['location']['href']
    location = window.location['href']
    location = self['location']
    location = self['location'].href
    location = self['location']['href']
    location = self.location['href']
    location.assign(location)
    location.replace(location)
    window.location.assign(location)
    window.location.replace(location)
    self.location.assign(location)
    

    和最后10:

    self['location']['replace'](self.location['href'])
    location.reload()
    location['reload']()
    window.location.reload()
    window['location'].reload()
    window.location['reload']()
    window['location']['reload']()
    self.location.reload()
    self['location'].reload()
    self.location['reload']()
    self['location']['reload']()
    

    来源文章


    只需使用..

    location.reload(true/false);
    

    如果为false,则页面将从缓存中重新加载,否则将从服务器中加载。

    链接地址: http://www.djcxy.com/p/28671.html

    上一篇: Refresh a page using JavaScript or HTML

    下一篇: How to reload a page using JavaScript?