PDA

View Full Version : [RESOLVED] Remote Control Windows


cmetz1977
07-04-2009, 05:32 AM
I am currently using window.open to launch a child window to do some sub-processes with the user. When the user finishes, I would like the child window to redirect the parent page and close itself.

I know how to do all this, but the whole thing becomes unhinged as the user browses in the child window.

Step 1

(from main window)
var childwindow = window.open( ... );
childwindow.parentwindow = self;

From this code, a child window: childwindow, is opened and it understands the variable 'parentwindow' to be the window from which it was launched.

Step 2
(The user browses through a few pages in childwindow to complete the sub-process. However, as the initial page unloads, the var parentwindow is lost.)

Step 3

(from remote window)
parentwindow.window.location = 'childwindowresult.html?childwindowresults=' + childwindowresults;
window.close( );


Is there a way to maintain the variable 'parentwindow' as the user navigates through 'childwindow'? Am I using the wrong approach altogether?

cmetz1977
07-05-2009, 03:17 AM
Apparently there is an object called 'opener' which stays with the window as you navigate.

So, no defining parents and children, just call document.opener.etc from the child window.

I hope this helps someone else somewhere