admin管理员组文章数量:1278792
I have the following javascript code that runs when a page is closed.
$(window).unload(function () {
window.opener.location.reload();
});
Is there a way to pass a paramenter to the page that calls this closed page ?
I have the following javascript code that runs when a page is closed.
$(window).unload(function () {
window.opener.location.reload();
});
Is there a way to pass a paramenter to the page that calls this closed page ?
Share Improve this question edited Jul 31, 2012 at 14:59 Frank Visaggio 3,71210 gold badges36 silver badges71 bronze badges asked Jul 31, 2012 at 14:52 Lucas_SantosLucas_Santos 4,74018 gold badges74 silver badges121 bronze badges 1- are you in a popup or in an iframe? – Hipny Commented Jul 31, 2012 at 14:54
2 Answers
Reset to default 6If you want to close popup and reload parent page, You should use this.
window.opener.location.href='/pageurl.html?id=1'
window.close();
The javascript variable window.parent should let you access to any parameters of the parent of the popup.
window.parent.reload();
from inside the popup should work.
As for the parameter
window.parent.variableName = 'Hello World!';
will create a variable name variableName in your parent.
So inside the parent, you will be able to do
alert(variableName);
and have an alert with the content 'Hello World!';
本文标签: javascriptReload parent page with parameterStack Overflow
版权声明:本文标题:javascript - Reload parent page with parameter - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741263776a2368086.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论