当子页面关闭时刷新父窗口 [英] Refresh Parent Window When Child Page close
本文介绍了当子页面关闭时刷新父窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
点击HTML按钮打开一个弹出窗口。从弹出窗口我将数据保存在表格中。我希望当我关闭窗口然后父页面自动刷新。
我尝试了不同的方法。比如我在子页面中编写了这段代码但是不起作用
I open a popup window by clicking an HTML button. From the popup I save data in a table. I want when I close the window then parent page refresh automatically.
I tried different ways. Such as I wrote this code in child page but does not work
body onunload="window.opener.location=window.opener.location;"
推荐答案
查看完整的样本 - 使用JavaScript在关闭时从子窗口刷新父窗口 [ ^ ]。
See the complete sample - Refresh Parent window from Child window on close using JavaScript[^].
你可以做父页面中的一件事就是这样写的
you can do one thing in parent page write like this
window.location.reload();
这篇关于当子页面关闭时刷新父窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文