[thelist] Window names - Javascript

Steve Bond steve.b at acheron.com
Mon May 29 22:21:25 2000


> What is the name of the intial window opened by a browser?  I'm opening a
> pop-up window and I want to reference a text area in the main window from
> it.

Norman,

Try "opener" as in "opener.document.forms". According to Danny Goodman's JS
Bible (pp129-132):
********
In scriptable browsers except Navigator 2, every window has a property
called "opener." The property contains a reference to the window or frame
that held the script whose "window.open()" statment generated the subwindow.
For the main browser window and fames therein, this value is "null." Because
the "opener" property is a valid window reference, you can use it to begin
the reference to items back in the original window, just like a script in a
child frame would use "parent" to access items in the parent document. The
parent-child terminology doesn't apply to subwindows, however.
********

Hope that helps.

--Steve

<TIP>
Danny Goodman's JavaScript Bible is the *BEST* desk reference for anyone who
has to use JS on a semi-regular basis.
</TIP>