Tutorials
JavaScript
JavaScript DOM Window Object
JavaScript Window Object defaultStatus Property
JavaScript Window Object Self PropertyThe defaultStatus property is a Read/Write property that can be set at any time and defines the default message displayed in a window's status bar. It is possible to set or return the default text in the status bar of the window using this property. The text is displayed during the loading of the page.
General syntax of defaultStatus property of Window Object:
window.defaultStatus=textmessage
For example:
window.defaultStatus = "Exforsys -Example of Status bar message to show defaultStatus property"
A complete program as example to understand the usage of this property:
<html>
<head>
<script type="text/javascript">
window.defaultStatus="Exforsys -Example of Status bar
message to show defaultStatus property"
</script>
</head>
</html>
The output of the above script is
Exforsys -Example of Status bar message to show defaultStatus property
The above message appears in the Status bar of the window as default text.
The status property is used to set or return the text in the status bar of a window. For a window, the defaultStatus property reflects the default message displayed in the status bar at the bottom of the window. This defaultStatus property is different from status property. The status property reflects a priority or transient message in the status bar, such as the message that appears when a mouseOver event occurs over an anchor. The defaultStatus property differs to the status property.
In defaultStatus property, the text is always shown in the status bar. The status property can be used to temporarily alter the status bar text. The status property can be used to temporarily change the text displayed in the status bar of a browser window. It is commonly used to set the status bar text when the mouse is moved over links in a document, so that more explanatory text, instead of a URL is displayed.
General syntax of status property of Window Object:
window.status=textmessage
For example:
window.status = "Exforsys -Example of Status bar message to show status property"
The usage looks similar to that of defaultStatus property however, the status property can be set at any time. For example, the programmer can place set the status bar message on the onMouseOver event as follows:
<html>
<head>
<script type="text/javascript">
<A HREF="http://www.exforsys.com"
onMouseOver="window.status='Exforsys -Example of
Status bar message to show status property';
return true">Place Mouse and See Status Bar</A>
</script>
</head>
</html>
The output of the above script is
Exforsys -Example of Status bar message to show status property
The above message appears in the Status bar of the window only when the user places the mouse over the link displayed as Place Mouse and See Status Bar.
Next Page: JavaScript Window Object Self Property