本文介绍了关闭子级时刷新父级窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用window打开一个子窗口.打开
我希望能够在关闭子窗口后刷新父窗口.通过单击窗口右上角的x可以关闭子窗口.我已经尝试过在孩子中这样做:
I am opening a child window using window. Open
I want to be able to refresh the parent window after the child window is closed. The child window is closed by clicking the x on the top right of the window. I have tried to do this in the child:
<body önunload = "window.opener.location.reload();">
但这不起作用.
有人可以帮忙吗?
But it is not working.
Can anyone please help?
推荐答案
window.close();
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}
谢谢,
Imdadhusen
Thanks,
Imdadhusen
这篇关于关闭子级时刷新父级窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!