刷新为新的页面
获得当前页面的url,即浏览器显示的地址:
window.location.href;
按下enter,页面刷新为百度
刷新为当前页面
1,history.go(0)
2,location.reload()
3,location=location
4,location.assign(location)
5,document.execcommand(‘refresh‘)
6,window.navigate(location)
7,location.replace(location)
8,document.url=location.href.
window.location.reload()
框架页中:(框架页中其中一个子页)
top.location.reload(); 刷新整页
self.location.reload(); 刷新本页
window.parent.location.href='' 框架页重定向
自动刷新页面的方法:
1,页面自动刷新:把如下代码加入<head>区域中<meta http-equiv="refresh" content="20">其中20指每隔20秒刷新一次页面。
<body οnlοad="opener.location.reload()"> 开窗时刷新
<body οnunlοad="opener.location.reload()"> 关闭时刷新。
例:数据添加成功后弹出对话框并刷新页面
if (infoaction_sort.insert(info_sort))