↑
Main Page
loading
Figure 5-9
Normally, the status bar tells the user when the page is loading and when it has finished loading; however,
it is possible to set its value using two properties of the window object:
status
and
defaultStatus
. As
you may have guessed,
status
changes the status bar text for a moment while
defaultStatus
changes it
as long as the user is on the page. For example, you may use a default status bar message when the page
first loads:
window.defaultStatus = “You are surfing www.wrox.com. “;
You may also want to display information about a certain link when the user moves the mouse over it:
<a href=”books.htm” onmouseover=”window.status=’Information on Wrox books.’
“>Books</a>
This is especially useful when using a JavaScript URL because browsers, by default, display the value of
the
href
attribute in the status bar when the user mouses over. Setting
window.status
can keep the
details of the link implementation from users:
The Statusbar
145
JavaScript in the Browser
08_579088 ch05.qxd 3/28/05 11:37 AM Page 145
Free JavaScript Editor
Ajax Editor
©
→