№ 288. On using JavaScript

I’m not a JavaScript fan, but I must admit it mkes happen lots of pretty things. This is probably why about half of the web design articles I read every day are JavaScript related. JS slowly got more and more popular, and sometimes I thing this frenzy is not so different from the overuse of animated GIFs in the beginning of the web.
While doing all those impressive things (e.g. vital IE6 fixes, slideshows, tabbed navigation, etc.), JavaScript still has two major drawbacks: it stuffs the code, making a page load considerably slower, and has an important usability issue. The high speed loading time may sometimes sacrified for the results (after all, we live in broadband connections era), but the usability issue shouldn’t be neglected. Fact is that many users out there have decided to disable the JavaScrpt in their browsers. They probably had unpleasant experiences with websites alterig their browsers behavior, or they’re sick of obtrusive ads, or they simply don’t know how to enable the JS (my mom doesn’t), the reasons don’t really matter; what matters though is that the percentage of JS disabled browsers is very close to the IE6 market share.
Back in 2007, 3.05% of the browsers located in US were JS disabled; ever since there, the percent must have been decreasing, but it is still important. To only give an example, 2.02% of the visitors of this blog disabled the JavaScript (and only 1.62% use IE6).
This means that a few percents of our readers will simply not see our nice anumated tag clouds, but something really ugly instead; and this is an optimistic situation, for they’ll sometimes see nothing.
I find it’s quite odd to see such a passionate debate around IE6, whether one should support it or drop it, and, on the other hand, to read almost nothing about the usability issues implied by the use of JavaScript. I think it’s awkward to see claims about giving “power to the people” (e.g. by using ems instead of pixels), and, on the very same pages, to see a pretty (an) useless JavaScript effect.
This is not, though, a diatribe. I don’t say one shouldn’t use JavaScript at all. on the contrary, I say one should use it everywhere he can. It has its undisputed advantages, both regarding the space management and the aesthetics of the presentation. But one should be very careful when deciding where he can use it.
This article is rather a note to self than the starting point of an eventual debate. Like many other web design decisions, using JavaScript is a matter of necessity and personal taste. I only wanted to remember myself to only use JS when necessary and especially when there’s a possibility for users with JS disabled browsers to reach the information is some other way.
To see what I mean, here’s the printscreen of a very popular WordPress theme, viewed with JS disabled:
javascript-disabled
PS Coming up soon: how to create a newspaper-style theme for WordPress, the resulting theme and a grid system.

Tags:

Published on the 2nd of June, 2009, in Design · Print

Leave a Reply

Recent comments

Colophon

This website was made by Delicia, who is deeply in love with WordPress. It is built on a 30x20px module, with Georgia and Helvetica/Arial. The design is the result of many years she spent reading Wittgenstein.