Forum Moderators: open

Message Too Old, No Replies

Controlling Parent Window from a Child Window

         

albroun

11:58 am on May 31, 2007 (gmt 0)

10+ Year Member



I am wondering whether it is possible to achieve the following:

There is a link on a page (call it Window1).
The new page loads into a new browser window (call it Window2).
There is a link in the new browser window (Window2) which controls what happens in Window1. More specifically, it loads a specific page into Window1, not necessarily the orginal page.

Is this possible, and if so how do I do it?

The reason for this is as follows:

I have a page (PageX) with links pointing to it from multiple pages (Pages A, B, C).
When a user arrives at PageX I want to direct them to another page via a clickable link, namely to Page D. I dont want Page D to load in the same window as PageX, nor open in a new browser window (to avoid window proliferation), but to load into the window via which Page x was accessed, i.e. page A, B or C.

Thanks for any help.

daveVk

5:42 am on Jun 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Window 1 can refered to from window 2 as window.opener.

So try

window.opener.document.location.href="pageD.html";
or
window.opener.document.location.replace("pageD.html");