By Stan Grabowski, Website Designer for Manufacturing-Works™
Part 4 of 4
"Failing gracefully..." It's like tripping over a crack and instead of landing on your face, you do a cart-wheel and land right back on your feet. You never intended to trip, but you didn't get hurt. But how could a website "trip?" Depending on how fancy your website is, with all its bells and whistles, your site may be set up to fail in a browser that doesn't work properly. The bigger they are the harder they fall...
...but it may not hurt as much if you have a safety net to fall into.
I was recently talking to someone who's website has drop-down menus. Their menu had the top most option, such as "About Us" and more options would show up when you put your mouse over the "About Us". From there you could navigate to the other sub-categories of the About Us section. It seemed to work just fine, until I disabled JavaScript. I was then stuck on the home page. I could not reach those sub-menu options, and there was no "About Us" page either. The visible "About Us" option was there merely to trigger the sub-menu; it did not link to anything.
So I'm stuck on the home page...
Now this was a deliberate problem I got myself into. I disabled the JavaScript. But JavaScript is not always available for everyone in every situation. The script may not work in a specific browser, or maybe the user is on their Blackberry or other handheld device. Maybe the user is a search engine! Search engines can't utilize JavaScript or Flash, so it would be stuck on the home page with me.
Drop down menus are often done with either JavaScript or Flash; neither of which are search-engine friendly. When a menu is built with JavaScript, it only exists in a visitors browser. Search engines don't use a mouse to navigate your site, so they will never see those drop-down options, and cannot follow those links to those pages. Search engines also cannot use Flash. If a search engine can't navigate your site, then your pages will not end up in the search engine's index, and no one will ever see those pages when they search.
You should think of JavaScript and Flash as "added frills," not a "required feature" of your site. All the information and content of your site should always be accessable with, or without Flash and JavaScript.
If your site must have drop down menus, consider these options:
Basically, you need to plan to fail sometimes. Make sure your site is still usable when Flash or JavaScript does not work.
I've built a demo of what I've been talking about in this article. Please visit the demo to see how a properly coded menu works versus an improperly coded menu. Please read the notes for clarification.
Again, this is an extensive subject that cannot be completely covered here. Feel free to contact me if you are interested in learning more.