使用 JavaScript 或 HTML 刷新页面

2022-08-30 00:35:05

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


答案 1

window.location.reload();在 JavaScript 中

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


答案 2

以下是使用javascript重新加载页面的535种方法,非常酷:

以下是前 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']()

原创文章