I load a page from another domain with iFrame which has target="_blank" links. When I click, the url is opened in a new page as usual. How can I avoid those links to be opened in new windows? I want those links to be opened inside the iframe.
Target=”_blank” links inside iframe
iframe
Related Topic
- Javascript – Redirect parent window from an iframe action
- Javascript – How to access parent Iframe from JavaScript
- Javascript – Access parent URL from iframe
- Javascript – Selecting an element in iframe with jQuery
- Javascript – How to open links in an iframe with target=“_blank” in the same iframe
- Html – target=”_blank” is not working in iframe
Best Answer
The only real solution would be to change
target="_blank"
totarget="_self"
. Or remove the target attribute completely and let the default action occur (which is_self
).This question might be a re-post of this: Force any HREF in an IFrame to use its parent as the target, but some of those techniques might be useful to you.
But if the page is on a domain you have no control over, you can't really do anything.