As a rails developer most of my experience with javascript libraries has been with prototype and scriptaculous, but I’ve never been quite happy with them. The helper methods built into ActionView make simple tasks a breeze, and I’ve played with the UJS plugin to improve the separation of content and behaviour, but even then the weight of the libraries and the comparable simplicty of tasks like iteration offered by jQuery has always made the grass over there look quite a bit greener.

So when Karl told me that he and Jonathan Chaffer were working on a book about jQuery and offered to send me a copy that seemed like the perfect opportunity to begin making the switch. (that comment should be taken as a disclaimer, by the way.) In the end the timing was fortuitous as I’ve ended up working on a couple of drupal projects (jQuery is included with drupal from version 5 onwards) and having to integrate some jQuery code into a rails project, so I’ve needed to take the lessons learned from the book and quickly put them into practice.

The book takes a gradual pace, introducing the library, and how it handles selectors, events and effects, before moving into DOM manipulation, AJAX and handling forms. Standardistas will be pleased that there is a strong emphasis on progressive enhancement, always starting with pages that achieve their basic intent and then using jQuery to improve the user experience. The authors place considerable emphasis on the importance of providing all users with a solid basic experience and show how jQuery makes it very easy to do so.

More experienced javascript developers may find the pace of the book a little slow (and might prefer to look out for the companion reference volume). The core audience is likely to be those who may have dabbled with the odd snippet, or perhaps used tools that generated javascript for them, but want a step-by-step tutorial that shows how to use jQuery to do things cleanly while building general understanding. Nevertheless, the coverage of more advanced topics like closures is solid and a good reminder even for the more experienced developer.

There were a couple of areas that could have done with a little more exposition, such as the fairly cursory coverage of the difference between GET and POST in HTTP requests (being a purist, I was really looking for mention of PUT and DELETE too), and the fact that without more work one of the shopping cart examples could leave the user thinking their updates had been saved when there was no mechanism to actually make the updates on the server-side. That said, hopefully by that point in the book most readers will be alert to such things and know that the examples are not necessarily production code.

If you’re looking to consolidate your javascript skills and like the look of jQuery, or, like me, you find that sometimes sitting down and reading a book is the best way to familiarise yourself with something, Learning jQuery is well worth your time and money. You can find it at packt, amazon US, amazon UK and all sorts of other places.