admin管理员组文章数量:1302378
I have injected an iframe in a webpage. In the iframe I have added a window.open()
, like this:
window.open("mypage", "_self");
But this refreshes the iframe with mypage. The requirement is to load this page in the same main browser.
How do I do that?
I have injected an iframe in a webpage. In the iframe I have added a window.open()
, like this:
window.open("mypage.", "_self");
But this refreshes the iframe with mypage.. The requirement is to load this page in the same main browser.
How do I do that?
Share Improve this question edited Nov 27, 2012 at 15:38 huysentruitw 28.2k10 gold badges94 silver badges141 bronze badges asked Nov 27, 2012 at 15:34 SamSam 1,3313 gold badges23 silver badges48 bronze badges 03 Answers
Reset to default 3Use window.open
if you want to open a window.
If you want to load a document into the current frame, then use location = "http://example.";
If you want to load a document into the top level frame, then use top.location = "http://example.";
Try this:
window.top.location.href = "http://mypage.";
Change
window.open("mypage.", "_self");
To
window.open("mypage.", "mypopupname");
本文标签: javascripthow to use windowopen in a iframeStack Overflow
版权声明:本文标题:javascript - how to use window.open in a iframe - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741690609a2392700.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论