I have an iframe I put on a page using a bookmarklet, I want this iframe to close itself when I navigate to a certain page inside this iframe.
How to do that using JavaScript?
Note: iframe and container page are in different domains.
I have an iframe I put on a page using a bookmarklet, I want this iframe to close itself when I navigate to a certain page inside this iframe.
How to do that using JavaScript?
Note: iframe and container page are in different domains.
As far as I know you cannot remove the element from the DOM from the iframe's container unless it's the same domain if I'm understanding you properly due to cross-domain security policies.
If this were possible you could infiltrate bank sites and all, it'd be a mess.
Beside @meder answer and his comments http://stackoverflow.com/questions/3033128/how-to-remove-iframe-from-parent-page-using-a-function-inside-the-iframe/3033152#3033152,
i found this answer http://stackoverflow.com/questions/2182027/close-iframe-cross-domain/2182058#2182058 Which helped me too much to solve my problem.
UPDATE: I found that this solution is not working on IE, and i failed to find a solution for that :(