JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Window.opener Property

Name

Window.opener Property---the window that opened this one

Availability

Navigator 3.0; read-only in Internet Explorer 3.0

Synopsis

window.opener

Description

The opener property is a read/write (read-only in Internet Explorer 3.0) reference to the Window object that contained the document that called open() to open this top-level browser window. This property is only valid for Window objects that represent top-level windows; not those that represent frames.

The opener property is useful so that a newly created window can refer to variables and functions defined in the window that created it.

Usage

The opener property does not exist in Navigator 2.0. You can use the following code for backward compatibility:

var newwin = open();
if (newwin != null && newwin.opener == null)
    newwin.opener = self;

See Also

"Window", "Window.open()"


Previous Home Next
Window.open() Book Index Window.Packages

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell