Web Design Mistakes 2: Javascript Abuse
This one is really quite simple — if you’ve built a site that uses Javascript, and you care about reaching any sort of audience, you need to do the following:
- Find a browser that will let you disable Javascript (most do).
- Disable Javascript (I bet you saw that coming)
- Try using your site
If your site is well designed, you’ll still be able to access all the content without Javascript. It might not look as pretty, and some of the dancing baloney will be gone. But at least you can read everything, see the images, and move from page to page.
However, if you’ve used Javascript with gay abandon, you may find that you can’t use the site properly. In particular, if you’ve built your navigation to rely on the presence of Javascript, you may not be able to get beyond the first page. This is a big problem.
You see, web demographers tell us that something like 10% of users have Javascript disabled. Why? I really don’t know — although I’ve certainly seen corporate environments where javascript is disabled due to security concerns, and this fact has been corroborated by some stats analysis I’ve done on my own sites. In any case, even locking out 1% of your potential audience is hard to justify if there’s a simple alternative.
That simple alternative is to make sure your Javascript degrades gracefully. Notice that I said “simple”, rather than “easy”. To write Javascript that degrades gracefully, you first have to learn how to write Javascript, and I suspect that is the source of a lot of the problems — too many developers think they can copy and paste snippets of Javascript into their pages and everything will be fine. However, there are very few Javascript examples that are robust enough to be pasted into a page without some sort of customisation.
Another culprit are WYSIWYG web design tools which automatically generate Javascript. My advice is: these tools are fine for simple image roll-over scripts, but anything that messes with the navigation or changes the content that displays on the page is not worth it, unless you already know enough Javascript to write the script yourself, in which case you can probably do a better job yourself!
The final clincher is that search engines are unable to interpret Javascript, so sites that rely on Javascript for navigation will not be indexed by search engines. For most sites, that makes your content “undiscoverable”. It doesn’t matter how clever that javascript hierarchical menu is. If your site can’t be Googled, the only people who will ever visit it are the client you built it for and their mother.
← Previously: Flash Abuse