Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / Javascript

Using JavaScript to Write to the Status Bar

Rate me:
Please Sign up or sign in to vote.
3.87/5 (16 votes)
4 Nov 2001CPOL 136.4K   36   4
Some of the simplest effects in JavaScript are also the most useful, in my opinion. One example is using JavaScript to write something to the status bar.

Introduction

Some of the simplest effects in JavaScript are also the most useful, in my opinion. One example is using JavaScript to write something to the status bar. The status bar is a lonely, empty place just waiting for you to take advantage of. You can use it to display a description of the link your mouse is currently over, show some message, etc.

To write to the status bar, use the JavaScript function:

JavaScript
<script>
function writetostatus(input){
    window.status=input
    return true
}
</script>

For example, I create a link below that uses this function to a description of the link onmouse over:

JavaScript
<a href="http://www.google.com" onMouseover="writetostatus('Search the web!')"
onMouseout="writetostatus('')">Google</a>

I like this example by Website Abstraction, which gets really creative and "unscrambles" the message into view.

Conclusion

The key to writing to the status is using the property window.status, and remembering to return true if you're adding it to a function.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 5 Pin
David A. Gray31-Aug-22 10:58
David A. Gray31-Aug-22 10:58 
QuestionIt only works in Opera Pin
Jayme Jeffman11-Feb-14 8:07
Jayme Jeffman11-Feb-14 8:07 
GeneralMy vote of 1 Pin
noname-20136-Dec-08 5:18
noname-20136-Dec-08 5:18 
poor
GeneralSome Good Resources Pin
Anonymous19-Aug-05 17:32
Anonymous19-Aug-05 17:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.