JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference

Window.defaultStatus Property


Window.defaultStatus Property---the default status line text


Navigator 2.0, Internet Explorer 3.0




defaultStatus is a read/write string property that specifies default text to appear in the window's status line. In Navigator, the status line is used to display the browser's progress while loading a file, and to display the destination of hypertext links that the mouse is over. While it is not displaying any of these transient messages, the status line is, by default, blank. However, you can set the defaultStatus property to specify a default message to be displayed when the status line is not otherwise in use, and you can read the defaultStatus property to determine what the default message is. The text you specify may be temporarily overwritten with other messages, such as those that are displayed when the user moves the mouse over a hypertext link, but the defaultStatus message will always be redisplayed when the transient message is erased.

If you set defaultStatus for a Window object that is a frame, the message you specify will be visible whenever the mouse is within that frame (whether or not that frame has focus). When you specify defaultStatus for a top-level window that contains no frames, your message is always visible when the window is visible. If you specify defaultStatus for a top-level window that contains frames, your message is only visible when the mouse is over the borders that separate the frames. Thus, in order to guarantee visibility of a message in a framed document, you should set defaultStatus for all frames in the document.


defaultStatus is used to display semi-permanent messages in the status line. To display transient messages, use the status property.

The defaultStatus property remains set when the browser moves from one page to another. If you set this property, you should be sure to reset it to the empty string ("") to restore the status line to its default blank state when the message is no longer applicable. A good way to do this is with the onUnload() event handler. Note that not all sites will be this considerate, so it is also a good idea to protect your web pages from other sites' default status messages by setting or resetting the defaultStatus property when your page is first loaded.

See Also

"Window", "Window.status"

Previous Home Next
Window.confirm() Book Index Window.document

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