Forum Moderators: open

Message Too Old, No Replies

Communicating between 2 windows

Interesting question inside!

         

SethCall

6:59 am on Oct 4, 2002 (gmt 0)

10+ Year Member



Ok, I have never used a pop-up window (opened with window.open) to talk back to the parent.

I have been reading, and it says the best way to do this is to use window.opener

Well. What if I have a mainpage: and i popup a window on that. And THAT window has a popup. So on my 3rd window, I want to affect a .style setting on the FIRST page!

Would this be: window.opener.window.opener?
or window.opener.opener?

I dont know yet what window.opener equals, at this point, in terms of specific details.

For example, if I wanted to mess with something on just the parent window (not that crazy example above: which I STILL need help on, btw:) )...

Can I call window.opener.document.getElementById?
Or is it window.opener.getElementyById?

I have so many wonderful plans for this javascript call, but I can't find good hard facts about it. Anyone want to guide me in this journey for knowledge?
:)
Thx!

SethCall

5:29 pm on Oct 4, 2002 (gmt 0)

10+ Year Member



well, THX BUT NOT THX! I have it all figured out.

Say u have a main page, and it opens up a pop-up (window.open)
And that pop-up opens up ANOTHER pop-up.

Then, in that 2nd pop-up

"window.opener.window.opener"

accesses the 1st page!

For example:

window.opener.window.opener.document.getElementById("title").style.visibility = "hidden";

Messes with a element on the first page.
And, not surprisingly, window.opener.opener works well, just as opener.opener would.. but I like to be specific.