2

I am working on a new home for my browser.

When the src changes of the iframe (click search or something) I want to leave my site and go to where the iframe is going. How do I do this?

edit:// example: http://imgur.com/OvnCz.jpg

twodayslate
  • 2,803
  • 3
  • 27
  • 43
  • So really, what you want to do is detect navigation events on a framed page, potentially one you don't control? – ThatBlairGuy Jun 01 '10 at 17:48
  • I suppose so. When the src of the page changes, go to that page. – twodayslate Jun 01 '10 at 18:09
  • If I can accomplish this without an iframe, that is fine. It seems like what I want is almost impossible with an iframe though. http://stackoverflow.com/questions/44359/how-do-i-get-the-current-location-of-an-iframe – twodayslate Jun 01 '10 at 18:13
  • 1
    I don't think that's going to turn out to be possible unless the framed page cooperates in some manner. – ThatBlairGuy Jun 02 '10 at 19:23

1 Answers1

2

Just put a target attribute on the link with a value of _top, like this:

<a href="http://www.google.com" target="_top">Google</a>

That tells the browser to open the link in the top-most frame, that is the whole browser window. More information can be found here

SWeko
  • 30,434
  • 10
  • 71
  • 106