Window.window (Property)

Another name for the self property.

Availability:

JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Opera - 3.0
Property/method value type:Window object
JavaScript syntax:-myWindow.window
-window

This is another name for the window.self property in this context. However, window is useful because you can remove the ambiguity associated with accessing global object properties and methods. Don't forget that this can also refer to a frame as well as a window since they are both represented by the window object.

If the script is running in the topmost window of a frame-set or within a non-frame-set window, the top property will also be set to the same value.

This property is slightly odd, because the window object is also the global object for a web browser. The global object is always placed in the scope chain for a script's execution context. So, all properties that belong to the window are available without requiring the window object prefix.

So, these all refer to the same thing:

window

window.self

self

window.window

self.self

self.window.self

window.window.window.window.window.self.window

The main use of this property is to yield slightly better readability and clarity in the code you write. The same applies to the self property. It is better to explicitly call window.open() rather than just open(). Explicitly calling window.open() avoids an inadvertent call to document.open(). You might not be aware of an open() method belonging to another object that has been placed into the scope chain ahead of the window object.

Warnings:

See also:Frame object, Window object, Window.frame, Window.self, Window.top

Property attributes:

ReadOnly.

insert figure 0079