Exforsys.com
 
Home Tutorials JavaScript
 

JavaScript DOM Window Object

 

JavaScript Window Object defaultStatus Property

Page 2 of 3


JavaScript Window Object defaultStatus Property:

The 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.


status property of Window Object:

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


Read Next: JavaScript Windows Object Properties Part I



 

 

Comments



Post Your Comment:

Members Please Login
Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe    

Sponsored Links

 

Subscribe via RSS


Get Daily Updates via Subscribe to Exforsys Free Training via email


Get Latest Free Training Updates delivered directly to your Inbox...

Enter your email address:


 

Subscribe to Exforsys Free Training via RSS
 

 
Partners -  Privacy and Legal Policy -  Site News -  Contact   Sitemap  

Copyright © 2000 - 2009 exforsys.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape