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


当前回答

Use:

window.location.reload();

其他回答

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

原文

window.location.reload ();在JavaScript中

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

Use:

window.location.reload();

试试这个效果很好

jQuery("body").load(window.location.href);

你也可以使用

<input type="button" value = "Refresh" onclick="history.go(0)" />

这对我来说很有效。