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?
This is MY world. You are just living in it.
Joined: Nov 03, 2004
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.
Joined: Nov 08, 2001
Also add the note: Once you change the parent window (refresh, close, change page), you loose the reference to the kids.