Lesson 5: Customizing the status Bar Messages


On the bottom of your browser their is a status bar. In the lower left corner is a text field that sometimes gives you information about what is under the mouse. It is easy to control what is displayed in this status bar. When a user doesn't know what an object is such as a button or a link, all he/she has to do is hover the mouse over the object and look at the status bar which will give him/her some useful information.

We are going to introduce a new eventhandler which will be triggered when a user hovers the mouse over an object. This event handler is called onMouseOver= . The only addition to this event handler is that it requires an expression that returns a true value. An example would explain more vividly...


[SCRIPT LANGUAGE="JavaScript"]
function showStatus(msg)
{
window.status=msg
return true
}
[/SCRIPT]
[/HEAD]
[BODY]
[A HREF="http://cnn.com" onMouseOver="return showStatus ('Takes you to CNN's web site')" onMouseOut=return showStatus('')">CNN [/A][P]
[/BODY]
[/HTML]

This nifty little feature creates a link to CNN's website. But our concern has to do with the user that doesn't know that. When the user hovers the mouse over the status bar should display 'Takes you to CNN's web site'. This happens with using the onMouseOver event. The window.status means that when the mouse hovers over this link it should display something in the status bar. The Try hovering the mouse over the link below and look at the status bar.

CNN