Progressive Enhancement with JavaScript
In this month’s A List Apart Aaron Gustafson concluded his trilogy of posts about progressive enhancement techniques. His first installment was Understanding Progressive Enhancement (issue no. 269) where he discussed the subtle difference between progressive enhancement and graceful degradation with the diagramatic analogy of the separation of layers (content, presentation and client-side scripting) as a peanut M&M. In his second installment Progressive Enhancment with CSS (issue no. 270) Aaron explained how to organise your stylesheets and how to deal with Internet Explorer 6.
Progressive Enhancement with JavaScript (issue No. 271) explains the intelligent approach to including JavaScript in your work. Not as a fix all kludge but as something which gracefully enhances your website for users who have the browser support while not impacting those users with outdated browsers. He briefly explains the basic strategy of placing your JavaScript into external files and writing unobtrusively, as well as the need for maintaining style separation.
In nearly every experience on teams where I’ve been involved, or even entered the conversation, these concepts have failed to be fully grasped. And they need to be grasped. Managers need to ditch the myth of pixel perfection across browsers and devices in favour of setting an acceptable baseline that enables users to access websites, then provide progressively enhanced features that can improve the experience for those with browsers that can handle it. The trick is ensuring that data is available at the baseline level rather than writing it in with your scripts. Does the baseline case work? Does it work without throwing errors?
Because used wisely and proficiently JavaScript is an empowering language for the web development behaviour layer. Used wildly it’s the bane of users and site maintainers far and wide. The difference between class and arse, so to speak. Excellent series from Aaron that needs to be carved into hardwood and bonked on the heads of certain managers and acedemics repeatedly (with a soft cushion perhaps).
You could understand your website as a scone which by itself and straight out of the oven might be oh so yummy! But you could enhance that with butter if you weren’t lactose intolerant and jam if you weren’t diabetic. So you can hand out scones quite freely as your baseline while those with knives and lactose tolerance can enjoy buttered scones and so forth. Does that make sense? As long as everyone gets the scone then you’ve provided a valuable service. What you need to avoid is depriving a lactose intolerant person of the scone simply because they don’t have a knife or can’t swallow the enhancement.
JavaScript, like a gun, doesn’t set out to harm anyone. The power is in the hand of the JavaScripter to appreciate the technology at hand and use it with discretion.



