I’m hosting an iFrame and it seems like when a link points to external domains it loads it on the main window and not in the iFrame.
Is there a way to force the links to be opened in the same iFrame?
Notice: I can add anything I want to the page loaded in the iFrame (using Chrome extension).
I tried adding:
<base target="_parent" />
But it didn’t do any good…
Check Headers of your external domain page. If
X-Frame-OptionsHeader is set toDENY, browser ignores loading content to iframe or frame set and loads in main frame of browser.Your Code
<base target="_parent" />is used for Loading the result into the parent browsing context of the current one. If there is no parent, this option behaves the same way as_self, so it can not solve your problemUse
<base target="myframe">instead wheremyframeis name of your iframe.Demonstration
Look for server headers for loading pages
References