Feature
Post

Category
Code

Danger Will Robinson! ~Status Bar Alerts~

The text that appears in the bottom left corner of your browser are called status bar alerts. Normally these are just messages that come from the browser it self pertaining to the functions of loading the website but it is good to look at what would be normal, boring functions of technology and come up with ways for it to communicate with your audience and further your brand.

I will show you how to throw in a static message in the bottom left corner of the browser but keep in mind that this only works in Internet Explorer as we are using the window.status object.

For a static message on the status bar we will use this piece of Javascript code:

HTML:
  1. <title>Status Bar Alert</title>
  2. <script language=”JavaScript”>
  3. <!–
  4. var statusbarmessage=”PUT YOUR MESSAGE HERE”;
  5. function statustype()
  6. {
  7. window.status = statusbarmessage;
  8. }
  9. >
  10. </script>
  11. </head>
  12. <body onload=”statustype()>
  13. </body>
  14. </html>

First the message is thrown into the variable statusbarmessage which is used as the parameter by window.status in statustype. The code activates in the body using onload and everytime that the page is displayed.

You can also do the same thing by deleting the variable var statusbarmessage and chucking the "PUT YOUR MESSAGE HERE" within quotes straight into the window.status.

E.g: window.status="PUT YOUR MESSAGE HERE"

However that is not good programing practice as future requirements could not be incorporated without having to re-write the code. I hope this helps you if you ever wondered how in the heck other designers were able to put messages down there!

  1. By Stefan posted on February 6, 2008 at 10:37 am
    Want an avatar? Get a gravatar! • You can link to this comment

    This is sooo 1998..

    Please, ignore this article and don’t manipulate your visitors browser. Don’t show any informations where they are not expected. For sure, the status bar alerts are not for usability.

  2. By Brian posted on February 6, 2008 at 11:56 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Amen, Stefan. This is awful. I can’t believe it’s not April 1st.

  3. By Ryan Williams posted on February 6, 2008 at 3:36 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    The article content on Devlounge has been getting very increasingly newbiefied. This is even more so than usual, though.

    I was under the impression that most Devlounge readers are relatively savvy web designers/developers, so doing little tricks like this isn’t really beyond what any of us could Google for within seconds if we wanted to actually do it (which we don’t).

    Not really an attack at this article in general, but I doubt anyone who’s been reading Devlounge for a while hasn’t noticed the BIG drop in complexity to articles.

    I mean, making galleries? Using favicons? Changing the status bar text? Activating caching in WordPress? This is all seriously amateur stuff — and Devlounge’s readership isn’t a bunch of amateurs AFAIK. I haven’t seen a compelling Devlounge article in months.

  4. By Ryan Williams posted on February 6, 2008 at 3:37 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    But yes, I agree: nobody should ever override status bar text. Being able to see the URL in the status bar is a very basic browser function, and overriding it is even worse than forcing links into new windows/tabs IMO.

  5. By Reflexion posted on February 6, 2008 at 5:03 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    Agreed that a lot of what I have been writing is very Simple topics however Just because you know things at a certain level doesnt Mean everyone else does. Simple subjects are ones that are rarely touced on and we can expand our readership by including topics That new developers would be on google searching for.

  6. By Aaron Bassett posted on February 7, 2008 at 9:28 am
    Want an avatar? Get a gravatar! • You can link to this comment

    Ignoring the “don’t mess with the user’s browser” problems, even the code itself, am sorry to say - just plain sucks!

    Where is the object detection? You say that it will only work with IE, but there is no checking to see if it is supported, everyone else be damned huh?

    // if(window.status) {

    And why are you polluting the global namespace? There’s this great new thing in Javascript (I hear some other languages might be getting them soon as well) called ARGUMENTS.
    These new fangled things let you pass all manners of information into a function, even strings!! wow!

    // function statustype(txt) {

    Am actually starting to think I have traveled back to 1998, what is this “language” attribute you speak of?

    //

    Look I get what you are saying about helping people at a lower level and expanding the reader base, but please if you want to help them don’t provide such crappy code for them to learn from :)

  7. By Pikadude No. 1 posted on February 7, 2008 at 5:50 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    New developers also don’t know that the status bar is a bad place to put important messages for a website’s visitors, for reasons Stefan and Ryan brought up. Yet you fail to mention this.

    If you want to teach your readers something simple, yet useful, how about the title attribute? All the handiness of window.status, plus portability across Web browsers, minus JavaScript, minus interfering with normal status bar functionality.

  8. By Aaron Bassett posted on February 8, 2008 at 6:36 am
    Want an avatar? Get a gravatar! • You can link to this comment

    sorry the comment system removed the last code in example in my previous comment, hopefully it should display this time:

    Am actually starting to think I have traveled back to 1998, what is this “language” attribute you speak of?

    // <script type=’text/javascript’>

  9. By Josh posted on February 15, 2008 at 9:09 am
    Want an avatar? Get a gravatar! • You can link to this comment

    To add to the growing voices of dissent: dear god, please remove this article. The only people who are going to listen are noobs who you should be influencing for the better, not to write outdated code like this.

  10. By Pikadude No. 1 posted on February 20, 2008 at 6:53 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    For clarity, my previous comment was directed at Reflexion, not at Aaron.

    Excluding the author, I count six unique commenters here, unanimously booing the article. Reflexion, are you going to react in some satisfactory fashion? (ie: editing the article, removing it entirely, or at least trying to defend the article)

    Do you even know what your commenters are talking about? Quick quiz: What is the title attribute? (not the title tag, which is entirely different)

  11. By Caesar's Grunt posted on February 22, 2008 at 2:36 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    I have to agree; please, please, remove this article, or at the very least add an explaination of why this shouldn’t be done if you don’t really know what you’re up to!

  12. By Caesar's Grunt posted on February 22, 2008 at 3:15 pm
    Want an avatar? Get a gravatar! • You can link to this comment

    A couple of other pointas :

    First, MSIE is not the only browser that ’supports’ this. Safari does, and I believe Icab, OmniWeb, and possibly Shiira do too.

    Second, this isn’t really the right way to go about setting a status message. If you use this method, then when the user mouses over a link, for example, the message will go and will not return after they mouseout. It’s better (from the point of view of getting your message in the statusbar) to use window.defaultstatus - then your text becomes a default status message, and is shown in the statusbar again after any temporary notification has gone.

    That said, it’s still best from a usability perspective to do neither. Plese add a warning! (I, myself, don’t actually mind this too much - it’s certainly not, in my opinion, as bad as forcing new windows all over the place when your visitor clicks on external links. I have even been known to use status messages myself in the past - but at least I was aware of the effects and implications first!)

  13. Trackback

    Your words are your own, so be nice and helpful if you can. If this is the first time you're posting a comment, it might go into moderation. Don't worry, it's not lost, so there's no need to repost it! We accept clean XHTML in comments, but don't overdo it please.