Reputation: 1279
i have iframe that shows content from the page that is not mine. In that iframe exists some links. When user clicks on links, they open inside iframe. I want them to open in current window (parent window).
I have found solution to add
target="_parent"
to links, but i cant do that, becouse iframed page is not mine, and i cant edit that page.
Is there some way to do this, to open links from iframe in parent window?
Or js/jquery code to find all links on that page and add them attribut target?
Upvotes: 0
Views: 435
Reputation: 23570
Unfortunatley it is not possible to query the content of an <iframe>
which origin is from a different server. The only thing what you could do is to "proxy" the page through a server-side script (with PHP or something) before outputting it:
target
-attribute on all links)Finally the <iframe>
could look like this: <iframe src="myproxy.php"></iframe>
Upvotes: 3