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/';
Yes, accessing parent page's URL is not allowed if the iframe and the main page are not in the same (sub)domain. However, if you just need the URL of the main page (i.e. the browser URL), you can try this: var url = (window. location !=
1 Expert Answer To force a single link from iframe to open in the parent window: add target="_PARENT" within that links anchor tag. To force ALL links from iframe to open in the parent window: add the base tag with target="_PARENT" in the head section of the iframe html page.
1) click on images link in iframe changes Parent page, click on another iframe image link changes Parent to another page (see below). can you please post the code you're currently using, in addition to the link you provided? You need to name the parent and use the target attribute.
try
window.opener.parent.location.href = '../account/';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With