如何使用 JavaScript 或 HTML 刷新页面?
使用 JavaScript 或 HTML 刷新页面
IT技术
javascript
html
page-refresh
2021-01-24 22:44:38
6个回答
window.location.reload();
在 JavaScript 中
<meta http-equiv="refresh" content="1">
在 HTML 中(其中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,则页面将从缓存重新加载,否则从服务器重新加载。
window.location.reload()
应该可以工作,但是有许多不同的选项,例如:
window.location.href=window.location.href
你也可以使用
<input type="button" value = "Refresh" onclick="history.go(0)" />
这对我来说可以。
其它你可能感兴趣的问题