JS页面刷新

window.history.go(0)
window.location.reload()
window.location.href
=location.href
window.location.assign(location.href)
document.execCommand('Refresh')
window.navigate(location.href)
window.navigate(
"#pos");
window.location.replace(location.href)
window.open('自身的文件','_self')
-------------
location.reload(flag)
flag 
=true 不从缓存读取
false 从缓存读取

如何用Javascript刷新另一个网页。比如说我在主网页上弹出一子网页
如果子网页提交表单到数据库后,同时也刷新主网页,这个效果用javascript如何实现?

 

答:此按钮的代码是:
<a href="JavaScript:opener.location.reload()">刷新</a>

如果想关闭窗口时刷新或者想开窗时刷新的话,在
<body>中调用以下语句即可。

<body onload="opener.location.reload()"> 开窗时刷新

<body onUnload="opener.location.reload()"> 关闭时刷新

<script language="JavaScript">
window.opener.document.location.reload()
</script>

评价:即加onUnload事件即可。
原文地址:https://www.cnblogs.com/publicbill/p/752224.html