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 0
Add a ment  | 

3 Answers 3

Reset to default 3

Use 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