Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can set location of parent from pop up window opened by iframe.

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/';
like image 810
Govind Malviya Avatar asked Sep 24 '11 06:09

Govind Malviya


People also ask

Can an iframe get parent URL?

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 !=

How do you force a link from iframe to be open in the parent window?

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.

How can I change parent URL in iframe?

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.


1 Answers

try

window.opener.parent.location.href = '../account/';
like image 192
Pa.M Avatar answered Sep 22 '22 00:09

Pa.M