JavaScript Window Object
JavaScript Window Object
Window Object
The Window object corresponds to the browser window. A Window object is created automatically with every instance of a <body> or <frameset> tag.
The Window object’s properties, methods, and events are described below:
NN: Netscape, IE: Internet ExplorerProperties
Syntax: window.property_name
Property | Description | NN | IE |
---|---|---|---|
closed | Returns a Boolean value that specifies whether a window has been closed | 3 | 4 |
defaultStatus | Defines the default text in the Windows’ statusbar (will be displayed when the page loads) | 2 | 3 |
document | The document object contained in the window | 2 | 3 |
frames | Returns all the named frames in the window | 2 | 3 |
history | Returns the URLs visited from the window | 2 | 3 |
length | Returns the number of child frames in the window | 6 | 4 |
location | Returns the URL of the window | 2 | 3 |
name | Returns or sets the name of the window | 2 | 3 |
navigator | 6 | 4 | |
opener | When using the window.open() method, you can use the opener property from the destination window to return details of the source window. Example: window.opener.close() will close the source window | 3 | 3 |
parent | A reference to the window that contains the calling child frame | 2 | 3 |
screen | 6 | 4 | |
self | 2 | 3 | |
status | 2 | 3 | |
top | 2 | 3 | |
window | 2 | 3 |