Reputation: 13753
I want to set location of parent window from pop up window opened by iframe.
I am writing this line of code in javascript but it is not working.
window.opener.parent.location = '../Account/';
Upvotes: 6
Views: 9019
Reputation: 2817
Should work with
window.parent.location.href = '../account/';
Upvotes: 1
Reputation: 8886
try some thing like this
<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>
In iframe
<a href="javascript:parent.change_parent_url('http://yahoo.com');">
Click here to change parent URL </a>
So you can see that child iframe calls parent's function and gives URL
Upvotes: 0