Unobtrusive JavaScript Gems
I’m diving in to ECMAScript for the first time, inspired by DOM Scripting (also called Unobtrusive JavaScript). As a web designer of a handful of years resorting to scripting has always left a bad aftertaste in my mouth, not so with these new techniques. Here’s a quick list of examples that have impressed me as I’ve been researching. (Not all of them fully comply with the ideals of unobtrusive script, but those that don’t could easily be.)
- Excellent unobtrusive JavaScript tutorial
- Display link URLs in printed copies of the page
- Nice ‘title’ display on hover
- Un-hypertext links to current page
- Fancy-ing form labels
- Client-side table sorting
- Client-side table striping
- Automatic page TOC generation
- Display blockquote ‘cite’ attribute & how to make tabbed sections by hiding/showing blocks
- Permanent anchor links to paragraphs
- Better date formatting
- Nasty drop down menus done right
- Edit any text on a page