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");