如何使用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秒)。
推荐文章
- CSS:控制项目符号和<li>之间的空格
- 什么时候JavaScript是同步的?
- HTML属性的长度有限制吗?
- 撇号的HTML代码
- 如何在Typescript中解析JSON字符串
- Javascript reduce()在对象
- 在angularJS中& vs @和=的区别是什么
- 错误"Uncaught SyntaxError:意外的标记与JSON.parse"
- JavaScript中的querySelector和querySelectorAll vs getElementsByClassName和getElementById
- 给一个数字加上st, nd, rd和th(序数)后缀
- 如何以编程方式触发引导模式?
- setTimeout带引号和不带括号的区别
- 为什么我的CSS3媒体查询不能在移动设备上工作?
- 在JS的Chrome CPU配置文件中,'self'和'total'之间的差异
- 用javascript检查输入字符串中是否包含数字