Javascript links are bad

Mark Pilgrim’s latest usability tip concerns using the “javascript:” protocol in links; or, more precisely, not using it. In general, good advice, although I have some reservations about one of his comments. Mark does say, though:

Don’t even get me started on those dynamic Javascript-based menu systems. They make you look cool like smoking makes you look cool. Use real links.

I don’t agree with this, necessarily. What you should not do is have those menus be your only navigation. There’s no problem with providing easier means of navigation for browsers that can cope with it, as long as you don’t cut off browsers that can’t. This is an unusual turn for Mark; up to now, his “accessibility” series has related very neatly to this principle, suggesting ways in which your code can accommodate those working with limited browsers or with disabilities but without impinging on its current structure if you don’t want to. This latest comment smacks a little of making everything “accessible” by designing solely for Lynx, and that’s not what the point of things like CSS are; it’s so that all browsers can get to your content and some can provide an optimised view. We could reduce the web to just being text, but if you want gopher then you know where to find it. ——-

More in the discussion (powered by webmentions)

  • (no mentions, yet.)