Load Iframe Links into Parent Window

How to force link from iframe to be opened in the parent window

I found the best solution was to use the base tag. Add the following to the head of the page in the iframe:

<base target="_parent">

This will load all links on the page in the parent window. If you want your links to load in a new window, use:

<base target="_blank">

Browser Support

What causes an iframe to open new links inside parent window?

<a href="http://en.wikipedia.org" target="_top">Top</a>

<a href="http://en.wikipedia.org" target="_self">Self</a>

The magic of target: http://jsfiddle.net/DerekL/wxcufehg/



Related Topics



Leave a reply



Submit