- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
Book review: Learning jQuery
Having spent most of the Ajax era at a large dot-com writing custom JavaScript backed by Prototype and some really solid internal libraries, I'm astounded by the staggering number of competing frameworks that have been quietly chugging along while I was busy elsewhere. It's time to play catch-up. Helping me in that mission are Jonathan Chaffer and Karl Swedberg, authors of the new "Learning jQuery: Better Interaction Design and Web Development with Simple JavaScript Techniques." The title's a bit of a mouthful, but this beginner's tutorial offers the same elegance and simplicity as the jQuery JavaScript framework itself. Assuming a solid grasp of basic UI technologies (XHTML, CSS and JavaScript) on the part of their audience, Chaffer and Swedberg dive right into the basics of using jQuery to speed development of RIAs.
There's a lot to like about jQuery the library:
- The CSS selector-based DOM traversal provides a single, unified method of manipulating your markup and data. It's less flexible than Prototype's grab bag of DOM methods, but it's easier to master. All of the major frameworks are scrambling to optimize their DOM traversal methods for speed and scalability, so it will be interesting to see how jQuery evolves.
- The crazy method-chaining allows simple, elegant DOM manipulation. Grab a node reference, change some visual properties and add behaviors - all on a single line.
- The stripped-down base library and plug-in framework offer an attractive solution to feature bloat and gigantic code footprints. The base jQuery library provides the underpinnings, but the plug-ins provide the bells and whistles one at a time.
- The organization of the jQuery object itself keeps the global namespace free and other libraries working properly. jQuery doesn't rewire core JavaScript objects, either, so it plays well with legacy code written in POJ.
As with jQuery itself, there's a lot to like about the book (which shares its title with a great website dedicated to the library). The authors cover all sorts of real-world UI issues - progressive enhancement of input forms, client-side validation, visual transitions during Ajax calls, manipulation of tabular data - and show how to code them in jQuery. The examples are pretty easy to follow whether you're trying them out as you read or just skimming each chapter to pick up the major ideas.
My biggest criticism of the book is also its biggest strength: As the title indicates, "Learning jQuery" is for novices. Its audience is Web designers and programmers who want to develop powerful UIs without getting into the details of browser compatibility, native DOM methods and other other nitty-gritty client-side concerns. It doesn't speak to more advanced developers who know all the ins and outs of DOM scripting and want to understand how the framework can help at the architectural level. It also doesn't highlight the differences between jQuery and other frameworks, much less make a compelling argument for why jQuery is better.
As it happens, I think jQuery offers some real advantages over the monolithic Prototype/Script.aculo.us school of RIA development - and over many of the other frameworks out there. (More on that later.) In the meantime, Chaffer and Swedberg have provided an excellent introduction to the framework and gotten it into bookstores, where it can sit alongside similar tomes from competing school of thought. Let the discussion continue.
Leave a comment
About Pathfinder
Recent
- Firefox Plugin Malware ‘Trojan.PWS.ChromeInject.A’
- Pathfinder releases version 1 of the its Flash Platform microsite (codename Mica)
- Pimp my Rails: Five Plugins & Gems to Make Rails Better
- iPhone: Using Pre-processor Directives for Device Testing
- Subtle OpenGL Projection Matrix Difference Between iPhone Simulator and Device
- App Security: Throw Out the Org Chart!
- Pimp my jQuery: Five plugins to replace the features Prototype and Scriptaculous users expect
- Thanksgiving 2008: What We’re Thankful For (In Rails)
- iPhone SDK: Testing with TextMate & GTM
- GWTQuery - JQuery-like Syntax in GWT
Archives
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006

