Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript, iframe - navigate/close parent window from iframe

Good day to all.

I have this setup:

One page with text/whatever, that also includes an iframe (the page in iframe is created by me so I have access to it, I can modify its content).

What I need to do is that when I access a link from the iframe to open it on the mother page (navigate).

Until now I kind of failed to do that so any help would be appreciated.

For any further info just ask.

like image 318
zozo Avatar asked May 10 '11 15:05

zozo


1 Answers

In all of the links that you want to affect the parent window do something like this:

<a href="somthing.html" target="_parent">GO THERE!</a>

Or with javascript:

<a href="javascript:window.parent.location = 'somthing.html';" >GO SOMEWHERE!</a>
like image 50
Naftali Avatar answered Oct 05 '22 07:10

Naftali