This allows you to build a hierarchy of parent and child windows. A window has a null value for this property if the window was opened directly by the user.
If necessary, you can modify the value in this property since it supports read and write access.
Not supported by Netscape 2 or version 3 of MSIE. You could simulate this property by storing the self property of the opening window in a property of your own that belongs to the object representing the new window. You could also check for the existence of this property and create it yourself if it is missing. Refer to the example to see how you can do this.
This value is meaningful for a top level window that contains a frame-set but it is not meaningful for frames within that window. Logically, if this is to indicate a window parentage, it should also refer to a top level window and not a frame within one, even if the window.open() method was executed from within a frame.
Although the value is apparently writable, it is difficult to think of a circumstance where you would want to redefine the parent window object.
// Create the new window var myNewWindow = open('url', 'windowName'); // Now set its opener property if it doesn't already exist if (!myNewWindow.opener) { myNewWindow.opener = window; }
Prev | Home | Next |
Window.open() | Up | Window.outerHeight |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |