Closing child pop-up and refreshing the parent page

旧城冷巷雨未停 提交于 2019-11-27 23:12:36

In the pop-up window:

<script type="text/javascript">
function proceed(){
   opener.location.reload(true);
   self.close();
}
</script>

<form onsubmit="proceed()">
...
</form>

In the popup's code for closing/reloading:

opener.location.reload();
close();

parent.html

<a href="#" onclick='window.open("child.html","_blank","height=100,width=100,
status=yes,toolbar=no,menubar=no,location=no");return false'>pop up</a>

child.html

<p>child window</p>
<script>
window.onload = function(){
    window.opener.location.reload(true);
    window.close();
}();
</script>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!