如何使用JavaScript或HTML刷新页面?


当前回答

window.location.reload()

应该工作,但有许多不同的选项,如:

window.location.href=window.location.href

其他回答

简单地使用. .

location.reload(true/false);

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

window.location.reload()

应该工作,但有许多不同的选项,如:

window.location.href=window.location.href

这里有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']()

原文

Use:

window.location.reload();

window.location.reload ();在JavaScript中

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