jmansa
1
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!
RCD24
3
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>
jmansa
5
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>
And if that isn’t what you want, answer the question in answer 2
jmansa
8
Thanks… The _top did the job…