Setting parent url from iFrame!?

Is it possible to set the parent url from within an iframe…

Let’s say that I have an url: http://www.mypage.com/index.php.
And within this page I have an iframe which source is: http://www.mypage.com/myiframe.php. In this page I have a link (<a href=“http://www.mypage.com/index.php?page=newpage”>)

Now I want to change the parent link when hitting this link… But don’t know how… Please help!

What do you mean?

I think what you may want is

<a href=“link-in-frame-page” target=“_top”>text</a>

The _Top over-rides the iframe you’re in and changes the overall page.

Try using the target attribute of the A Href tag:

<a href=yoursite target=_top>click here</a>

I found this, but can this be done without javascript?

Parent window's content:

    <b>iframe starts here</b><br><br>
    <iframe src='iframe1.html'></iframe>

    <br><br>
    <b>iframe ends here</b>
	
    <script type="text/javascript">
        function change_parent_url(url)
        {
	    document.location=url;
        }		
    </script>
Iframe's content:

    IFRAME content<br><br>

     <a href="javascript:parent.change_parent_url('http://yahoo.com');">
	Click here to change parent URL </a>

Look at answer 3 and 4… :slight_smile:

And if that isn’t what you want, answer the question in answer 2 :slight_smile:

Thanks… The _top did the job…