• 2
name Punditsdkoslkdosdkoskdo

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

I need to open the link in the same parent page, instead of open it in a new page.

note : The iframe and parent page are the same domain.

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">

This tag is fully supported in all browsers.

  • 0
Reply Report