Writing for the World Wide Web
Window Status Messages
People often look at the status bar in the browser to see where a particular link address might lead; however, sometimes this space can be used to provide additional information or messages to users through the use of a rather simple JavaScript. Do remember, however, that when using this script, the trade-off is that the user won't be able to see the address of the link they are mousing-over. Here are the lines of code:

<a href="index.html" onmouseover="window.status='Here is a message.'; return true;" onmouseout="window.status=''; return true;">Check out the status bar.</a>

The above lines of code will create the following display:

Check out the status bar.

Here is a basic breakdown of what each part means:

  • onmouseover—this executes a JavaScript function when the mouse cursor moves over the link; this JavaScript function usually turns some feature on
  • onmouseout—this executes a different JavaScript function when the mouse cursor moves over the link; this JavaScript function usually turns some feature off
  • window.status—refers to the status bar in the browser and changes it to the message in 'single quotes'; never use double quotes (") or single quotes/apostrophes (') as part of your message in the window.status because it will cause an error in the JavaScript


Home | Course Information | Assignments | Schedule | Class Notes | Resources | Student Pages