wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Keeping track of other browser windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Keeping track of other browser windows" Watch "Keeping track of other browser windows" New topic
Author

Keeping track of other browser windows

Tim Manchester
Ranch Hand

Joined: Nov 03, 2004
Posts: 62
Howdy,

I have a problem that's got me stumped. First off I'm using I.E. 6 and expect all users to be using the same browser. I start on one page (let's call it the "parent" page). This page has globally defined a method so that it can be called from another page.

I do this in the following way inside <SCRIPT> tags:


In additon, the "parent" page opens a child browser window (let's call it "kiddie") by clicking an html:button opens a child window. Now this child window can call the testPopup method in it's parent pretty easily:


But the problem I have here is that the child browser may navigate to one more page (let's call this page "grandkid"). Here on "grandkid" (the new page) I still need to call the testPopup method on the "parent" page. What I don't have on "grandkid" is a reference to "parent". How do I get one?

Regards,

Tim Manchester
Tim Manchester
Ranch Hand

Joined: Nov 03, 2004
Posts: 62
Well I found the answer and thought I might as well post it here for folks. It seems that the window.opener variable remains contstant throughout the chain of execution, so in the window "grandkid" you can still call upon window.opener.testPopup(); and it calls all the way back into the "parent" window. Cool.

Regards,

Tim Manchester
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Also add the note: Once you change the parent window (refresh, close, change page), you loose the reference to the kids.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Keeping track of other browser windows