JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference

Window.opener Property


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


Navigator 3.0; read-only in Internet Explorer 3.0




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.


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", ""

Previous Home Next Book Index Window.Packages

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