如何使用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)" />
这对我来说很有效。
推荐文章
- 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检查输入字符串中是否包含数字