JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Window.top Property

Name

Window.top Property---the window of a frame

Availability

Navigator 2.0, Internet Explorer 3.0

Synopsis

window.top

Description

The top property is a read-only reference to the Window object that is the top-level window that contains window. If window is a top-level window itself, then the top property simply contains a reference to window. If window is a frame, then the top property contains a reference to the top-level window that contains the frame. Note that the top property refers to a top-level window even if window refers to a frame contained within another frame (which may itself be contained within a frame, and so on). Compare this with the Window.parent property.

Usage

Certain operations, such as setting the status and defaultStatus properties only are useful when performed on a top-level window. When JavaScript code running in a frame needs to operate on its top-level window, it can use the top property. For example, it could display a message in the message line as follows:

top.defaultStatus = 'Welcome to my Home Page!';

See Also

"Window", "Window.parent"


Previous Home Next
Window.sun Book Index Window.window

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