您的位置:首页 > Web前端 > JavaScript

JS--刷新当前页面

2017-02-22 07:23 302 查看
 

 http://blog.csdn.net/xxb2008

//Javascript刷新页面的几种方法:
history.go(0)
location.reload()
location=location
location.assign(location)
document.execCommand('Refresh')
window.navigate(location)
location.replace(location)
document.URL=location.href

//框架刷新

opener.location.reload()   ////子窗口刷新父窗口
window.opener.document.location.reload()

parent.FrameID.location.reload(); //刷新iframe
window.parent.frames[1].location.reload()//刷新frame
window.parent.frames.bottom.location.reload() //bottom frame名称

//自动刷新页面的方法:
<meta http-equiv="refresh" content="20"> //每隔20秒刷新一次
<meta http-equiv="refresh" content="20;url=http://www.aaa.net"> //指隔20秒后跳转到http://www.aa.net页面

http://blog.csdn.net/xxb2008

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: