[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Communicating between windows...



The idea here is to create a new property for the spawned window.  You can
name it any thing you like; "creator" is a good one, and tends to be used
the most around these here parts.  The syntax is the window-spawn function
goes like this:

        win = window.open ("openme.html")
        win.creator = self

Then in the opened window (openme.html in the above example), you just call
the function as a property of creator.  Like this:

        creator.alertMe();

The alertMe() function can contain whatever you want in it.

-- Gordon

At 01:57 PM 3/6/96 EST, you wrote:
>I have a JS that opens a window, as in:
>
>     win = window.open(.....).
>
>The opened window's <body> tag includes an onUnload clause.  If the user closes
>the second window from the user interface, I want the onUnload clause to report
>back to the originating window that the second window has closed.  I cannot
>figure out a way to do that.  There does not seem to be a way for the second
>window to refer back to a method in the original window, for example to
invoke a
>function in the original window.
>
>Anyone have any ideas how to accomplish this?  (I've considered using cookies
>but it seems like such a hack to do that.)
>

--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/