Reputation: 11829
We have this iFrame inside our homepage which shows content from another website. And there are links within this iFrame. What happens is, when we click on the link, the content shows within the iFrame and not on the actual website (which contains the iFrame).
We already tried putting target = _top like so:
<a href='http://$host/ourwebsite.php?no=$prikey&...etc' target='_top'>
And the links do open like other pages on the actual website (meaning, not inside the iFrame). However, the URL changes to show the entire URL of the iFrame meaning it shows something like (not exactly, just a sample to demonstrate it):
instead of just...
The worst thing is, when we go to any other page, the URL on the address bar keeps showing the iFrame URL, even if those pages aren't actually inside the iFrame.
Is there a way to link from the iFrame and show the URL (when the link is clicked) of the actual website and not the URL of the iFrame? Like mask it or something?
Upvotes: 1
Views: 3067
Reputation: 8886
Hi
In order to get the links within the iframe to load within the parent document, you need to specify this on the links themselves with the target attribute:
<a href="page.html" target="_parent">link to parent</a>
Upvotes: 3