Spry: A Completely Unobtrusive Accordion Example
I can’t tell you how much fun I have when challenged by the “standards” crowd to implement something with the Spry framework for AJAX. At the end of last week, I was privy to a conversation that Stephanie Sullivan was having with one of her fellow WaSP colleagues concerning Spry’s ability to be completely unobtrusive. In other words, to provide a completely standards-based, bare bones version of the page free of any extraneous semantic markup and/or JavaScript, and then to progressively enhance the page with AJAX functionality only at runtime for JavaScript-enabled user agents.
As you may have read here, I covered this technique in chapter 6 of Mastering CSS with Dreamweaver CS3 using not only the ability to externalize the JavaScript code which initializes the Spry widgets (a Spry Menubar and Sliding Panels widget), but also dynamically assigning the Spry attributes such as “spry:region” via the same external JavaScript. The issue was raised, however, that there was still some unnecessary code in the page – from a standards’ viewpoint. To understand this, let’s take a look at a simple accordion in Spry. (more…)
6 Comments »