I have injected an iframe in a webpage. In the iframe I have added a window.open(), like this:
window.open("mypage.com", "_self");
But this refreshes the iframe with mypage.com. The requirement is to load this page in the same main browser.
How do I do that?
Use
window.openif you want to open a window.If you want to load a document into the current frame, then use
location = "http://example.com";If you want to load a document into the top level frame, then use
top.location = "http://example.com";