Simon Willison’s Weblog

Subscribe

More unobtrusive DHTML

2nd July 2003

I’ve talked about unobtrusive DHTML before, and here’s a superb example of it in practise from Chris Casciano. His zeitgeist is enhanced by some clever javascript which hides and reveals tables of data when certain page elements are clicked. View source, and you’ll see that the document contains only structural HTML, with no embedded javascript at all. The special behaviour is added by an external Javascript file which adds the necessary event handlers when it loads, based on the structure of the existing document. This approach maintains the usability of the information in a non-javascript supporting environment, while seriously enhancing the maintainaility of the page as new structural elements can be added to the HTML which will pick up the special behaviour without any further modification to the javascript needed.

This is More unobtrusive DHTML by Simon Willison, posted on 2nd July 2003.

Next: Norwegian Hixie

Previous: CSS Roundup

Previously hosted at http://simon.incutio.com/archive/2003/07/02/cascianoZeitgeist