Forum Moderators: open
Instead of using onmouseover and onmouseout, I've been putting the text I want to display in the status bar into the href. (This works for JavaScript links only!)
<a href="status-prefix: Enter your status bar message here" onclick="alert('put your JavaScript here');return false">Mouseover to see status bar text</a>
You need to have a colon in the href before you enter any spaces. This is needed to make the browser think it is a real URL using a custom protocol.
What do you think of this method? Could it cause any problems?
My method works because you are linking directly to the text of the message you want in the status bar, and browsers will show your message as the URL. The trick to making this work is having a short prefix with a colon, this makes it so it doesn't display http;//www.yourwebsite.com/dir/ at the beginning of the url.
Newer browsers are now preventing you from setting the text in the status bar from JavaScript.
And with good reason. As tedster exlpained in the link above, you shouldn't over-ride the status bar. Users are expecting a certain behavior from their browser, so it's not a good idea to change that.
It has been recommended by tedster that you shouldn't manually over-ride the message bar.
And yet you still are.
My method works because you are linking directly to the text of the message you want in the status bar, and browsers will show your message as the URL.
Which, again, is NOT the behavior a user will expect.
However...
Your approach has one major flaw. A user that has JavaScript disabled will not be able to see the contents of your tab. Clicking on the tab will result in an error like:
Firefox doesn't know how to open this address, because the protocol (menu-change) isn't associated with any program
In other words, instead of taking a "progressive enhancement" approach, where the core content is always available no matter what user agent is used or what technologies are available, you have made JavaScript a requirement.
A better approach would be to develop your tabs using semantic markup. For example:
<ul>
<li><a href="#AdvancedFontSettings">Font Settings</a></li>
<li><a href="#BorderSettings">Border Settings</a></li>
</ul>
<div id="AdvancedFontSettings">...</div>
<div id="BorderSettings">...</div>
Then use progressive enhancement techniques to turn this into a tabbed structure, so it's accessble whether or not the user has JavaScript.
If you're set against making your site/application available to everyone, then maybe instead of using "menu-change: " as the prefix, perhaps you could using "#"? While it still wouldn't work in your example for sites with JavaScript disabled, I suspect it would at least prevent an ugly error message about an unknown protocol.
I added a message to the page than Javascript is required.
If I use "#" it adds the the the full url as the prefix. I would rather have the status bar show "menu-change: Advanced Font Settings" than show "http : //www.mydomainname.com/dir/my-url-can-be-very-long.htm#AdvancedFontSettings"
<li title="Advanced font selection">Font Settings</li>
That avoids the whole "trust issue" involved with changing the status bar, and puts the explanation at the visitor's visual point of focus.
Just a note that disabling status bar text changes is one of the things that's an easy option in Firefox, and I do exactly that so as to easily reveal phishing sites. You can do what you like on-page, but I no longer allow sites to mess with my chrome.
Jim