Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Keeping track of other browser windows

 
Tim Manchester
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also add the note: Once you change the parent window (refresh, close, change page), you loose the reference to the kids.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic