Properties

The following properties are available for the window object:

Property Description
clientInformation A reference that returns the navigator object for the browser
closed A true or false value that indicates whether a window is closed
defaultStatus The text that is displayed in the browser's status bar by default
dialogArguments Returns arguments that were passed into a dialog window, as an array
dialogHeight Sets or returns the height of a dialog window
dialogLeft Sets or returns the x coordinate of a dialog window
dialogTop Sets or returns the y coordinate of a dialog window
dialogWidth Sets or returns the width of a dialog window
document Read-only reference to the window.document object
event Read-only reference to the global event object
history Read-only reference to the window.history object
length Returns the number of elements in a collection
name The name of the window object
navigator Read-only reference to the window.navigator object
offScreenBuffering Specifies whether or not to use off-screen buffering for the document
opener A reference to the window object that opened this window object
parent A reference to the parent of the current window object (for use with frames)
returnValue Allows a return value to be specified for the event or dialog window
screen Read-only reference to the global screen object
self A reference to the current window
status Text displayed in the browser's status bar
top A reference to the top-most window object (for use with frames)

When using property, method or event names in JavaScript, you must be very careful, as JavaScript is case sensitive, so while defaultStatus would be a correct reference, defaultstatus would return an error. In VBScript however, either version would be acceptable!

The opener, parent, self, and top properties are useful when we write code that deals with more than one window object. As we'll discuss when we talk about the frames collection below, multiple window objects can come about when the page we're displaying has multiple frames and when we've explicitly created new windows with the open method (which we'll also discuss shortly).

 The dialogArguments, dialogHeight, dialogLeft, dialogTop and dialogWidth properties can all be used to set the various properties of a dialog window. We take a look at dialogs later in this chapter.

The other two useful properties are defaultStatus and status. Both of these properties control what is displayed in the status bar of the browser, when the page is first displayed and afterwards respectively.