Opening anchor tag from iframe in parent frame

Given the following HTML, is it possible to bind an anchor tag in an iframe to the parent window?

<div> <iframe src="/pageview.html"></iframe> </div> 

iframe (pageview.html):

 <a href="http://www.google.com">link</a> 
+7
source share
2 answers

You need the target attribute:

 <a href="something" target="_parent">go</a> 

Using _parent will target the nearest parent frame window. To target the top window, use _top .

+13
source
 <div> <iframe src="/pageview.html"> <a onclick="javascript:window.parent.location.href='http://www.google.com'; return false;">link</a> </iframe> </div> 

There must be something like that ...

+2
source

All Articles