Make it sparkle with Ajax
Another thing to ponder when considering using Ajax is just how and where it will benefit your users most in your web application – not all areas can benefit equally from Ajax, even though some can be transformed by a little thought and a few snippets of code. Most of us trawl the internet looking for help with such tasks, but I often find having a good book on the subject can help enormously. One such book I can recommend is Adding Ajax from O’Reilly, which covers the use of many of the Ajax libraries such as Prototype, Script.aculo.us, Rico, Dojo, jQuery, MochKit, YahooUI, mooTools and moo.fx, Sarissa and WZ_jsGraphics. The book also covers writing your own Ajax effects without the use of libraries, and it’s a very valuable aid to have by your side (or even to read on holiday while dreaming of the cool web application you’re going to build when you get back).
If you want to add some alternative Ajax functionality to your website, you couldn’t do much better than to look at all the samples at http://miniajax.com, which are really very good and generally easy to implement. It will certainly give you plenty of ideas, but please don’t make the mistake many people made with animated GIFs in the early days of the web and overdo it.
Spry and Spry again
One Ajax library that I haven’t mentioned yet (and nor does the O’Reilly book) is called Spry, from Adobe. The documentation is good and it isn’t too difficult to use this library, but it’s a case of adding code manually, or rather it was until now. The latest version of Dreamweaver, called CS3 in line with the other Adobe products, now has support for the Spry Framework among several other new features.
In fact, it’s worth taking a quick look at a couple of the new features in Dreamweaver, which for my money make this upgrade worth the cost. First, as just mentioned, is its support for Ajax in the form of the Spry Framework: to use these features, simply click on the Spry tool bar and a dialog opens into which you enter the details – and that’s about it, your first piece of Ajax!
So what features does the Spry Framework give you? First, there’s a simple collapsible panel that enables page content to be hidden and expanded again whenever the user clicks the panel’s top bar. This content is still on the page, so you’re not saving anything in page file size, but it’s an interesting way to cram a lot of content into a smaller area of the browser window. The Accordion object is a slightly more complex version of this component, which allows multiple collapsible areas.