Navigator 2.0, Internet Explorer 3.0; enhanced in Navigator 3.0
self the current window window the current window
A read/write string that specifies the default message to appear in the status line.
A reference to the Document object contained in the window.
An array of frames contained by this window.
A reference to the History object for this window.
A reference to the JavaPackage object that is the top of the package name hierarchy for the core java.* packages that comprise the Java language.
The number of elements in the frames array. Same as frames.length. Read-only.
A reference to the Location object for this window.
A reference to an object holding various mathematical functions and constants.
A string that contains the name of the window. The name is optionally specified when the window is created with the open() method. In Navigator 2.0 and Internet Explorer 3.0, this property is read-only. In Navigator 3.0 and later it is read/write.
A reference to the Navigator object that applies to this and all other windows.
A reference to the JavaPackage object which is the top of the Java package name hierarchy for the netscape.* Java packages from Netscape.
A read/write property that refers to the Window object that called open() to create this window. Available in Navigator 3.0 and later.
A reference to a JavaPackage object that represents the top of the Java package name hierarchy.
A reference to the parent window or frame of the current window. Only useful when the current window is a frame rather than a top-level window.
A reference to the window itself. A synonym of window.
A read/write string that specifies the current contents of the status line.
A reference to the JavaPackage object which is the top of the Java package name hierarchy for the sun.* Java packages from Sun Microsystems.
A reference to the top-level window that contains the current window. Only useful when the current window is a frame rather than a top-level window.
A reference to the window itself. A synonym of self.
Display a simple message in a dialog box.
Take keyboard focus from the top-level browser window; this sends the window to the background on most platforms.
Cancel a pending timeout operation.
Close a window.
Ask a yes-or-no question with a dialog box.
Give the top-level browser window keyboard focus; this brings the window to the front on most platforms.
Create and open a new window.
Ask for simple string input with a dialog box.
Scroll the document displayed in the window.
Execute code after a specified amount of time elapses.
An event handler invoked when the window loses focus.
An event handler invoked when the window gains focus.
An event handler invoked when the document (or frameset) is fully loaded.
An event handler invoked when the browser leaves the current document or frameset.
The Window object does have window and self properties that refer to the window object itself. You can use these when you want to make the current window reference explicit rather than implicit. In addition to these two properties, the parent, and top properties and the frames array refer to other Window objects related to the current one.
To refer to a frame within a window, use:
frames[i] or self.frames[i] // frames of current window window.frames[i] // frames of specified window
To refer to the parent window (or frame) of a frame, use:
parent or self.parent // parent of current window window.parent // parent of specified window
To refer to the top-level browser window from any frame contained within it, use:
top or self.top // top window of current frame window.top // top window of specified frame
New top-level browser windows are created with the Window.open() method. When you call this method, save the return value of the open() call in a variable, and use that variable to reference the new window. In Navigator 3.0, the opener property of the new window is a reference back to the window that opened it.
In general, the methods of the Window object manipulate the browser window or frame in some way. The alert(), confirm() and prompt() methods are notable: they interact with the user through simple dialog boxes.