Categories:
Partners
Web Hosting
We've partnered with HostGator for reliable, affordable hosting starting at $3.95/mon. Use coupon code "javascriptkit25" for 25% off any package.

"Learning jQuery" Book review

Book review by JavaScriptKit.com | Publisher: Packt. Author(s): Jonathan Chaffer and Karl Swedberg | Reviewed on: Feburary 2nd, 2008'

jQuery is one of at least a dozen JavaScript frameworks that have exploded onto the scene during the last few years, and for good reason. The Web 2.0 era has called upon JavaScript in a big way, turning to it as the driving force behind all the gliz and glamour that defines any Web 2.0 site. This huge increase in workload for JavaScript has called out for JavaScript frameworks that do the heavy lifting of common Web 2.0 tasks for us, from common visual effects such as fading, DOM traversal/ manipulation, to of course, Ajax interaction. jQuery has risen to become one of the most popular JavaScript framework due to its small footprint and focus on just the core tasks shared by almost any Web 2.0 project. A few books have sprung up to go beyond the jQuery documentation in explaining all that this framework has to offer, one of them being "Learning jQuery" (Packt Publishing).

"Learning jQuery" compliments the official jQuery documentation nicely, as its focus is on how to harness the power of jQuery to replace things you're used to do using raw JavaScript. The book is structured so that each chapter acts as a building block to the next, and requires no previous knowledge of jQuery to begin. The book's TOC is as follows:

Chapter 1: Getting Started
Chapter 2: Selectors–How to Get Anything You Want
Chapter 3: Events–How to Pull the Trigger
Chapter 4: Effects–How to Add Flair to Your Actions
Chapter 5: DOM Manipulation–How to Change Your Page on Command
Chapter 6: AJAX–How to Make Your Site Buzzword-Compliant
Chapter 7: Table Manipulation
Chapter 8: Forms with Function
Chapter 9: Shufflers and Rotators
Chapter 10: Plug-ins
Appendix A: Online Resources
Appendix B: Development Tools
Appendix C: JavaScript Closures

Chapter one quickly prepares you for the syntax conventions used by jQuery before opening the flood gates. Each chapter thereon examines a different area handled by "normal" JavaScript, and how that process can be simplified greatly using jQuery. One of the greatest strengths of jQuery lies in its DOM and elements traversal abilities, and in Chapter 2, the reader is shown how to turn their understanding of CSS and XPath Selectors as basis for actually accessing those elements, using jQuery. It also explains the concept of "chaining" in jQuery, or the ability to perform multiple actions on multiple elements all in one scoop. The sharp turn from introduction to getting straight to the heart of jQuery does mean you better have a firm grasp on JavaScript and CSS already before picking up this book, or you'll get lost very quickly. This is more of a praise than a criticism however- jQuery is what you're going to get with this book, nothing more (or less depending on how you see it).

In Chapter 3, the reader is shown how to attach and remove events to elements using jQuery, and how jQuery expedites things in terms of cross browser compatibility and more subtle issues like taking care of potential memory leaks in IE. Essential event related tasks like preventing event bubbling, event propagation, and cancelling default actions are also discussed within the context of using jQuery. 

Chapter 4 looks at jQuery's built in abilities for rendering effects like element fading, sliding in/out, movement across the page etc. jQuery isn't exactly an effects centric library like MooTools, but there are still areas it covers that the jQuery documentation itself does a poor job of, such as the animate() method and how to queue effects.

Chapter 5 breaks down DOM and HTML manipulation using jQuery, a task that is currently quite tedious for the purists that go through the standard DOM methods on their own to accomplish. You'll learn things like using jQuery to insert new elements, move elements, copying and appending elements to the document on demand.

In Chapter 6, "Learning jQuery" woes the Web 2.0 crowd by going into detail jQuery's Ajax abilities, and how it makes light work of common tasks such as performing GET/POST requests, fetching data as either JSON or XML and parsing it using jQuery. There are quite a few Ajax related methods in jQuery, some redundant IMO, and this chapter does start to lose focus by trying to cover too many of them, instead of limiting itself to just methods that do not overlap in function. Nonetheless, it's still better than the jQuery documentation, that's for sure.

Up until this point, all the chapters have been "building blocks" in nature, one paving the way to the next. However, starting in Chapter 7,  "Table Manipulation", breaks away from this roadmap and looks at common tasks of the day that can be simplified and enhanced using jQuery. There are additional jQuery tips you pick up as you read these chapters, though the focus now is more on the application rather than new techniques. Chapter 8 "Forms with Function" arguably has the most mass appeal, containing numerous examples that are manageable in size and somewhat self contained, from the obligatory required fields validation, checking for specific data types like numbers, currency etc, to Ajax infused forms.

The concept of "closures" in JavaScript is interwoven into every aspect of jQuery when it comes to its deployment, and to that end, the final section of this book, "Appendix C" provides a good tutorial on JavaScript closures. It's a fitting and nice conclusion to a great book.

There currently aren't many other jQuery books to compare "Learning jQuery" to, but it really doesn't matter. If you're new to jQuery or JavaScript frameworks in general yet aren't new to JavaScript itself, it's hard to go wrong with picking up "Learning jQuery" to learn jQuery.

Related Resources:

 

Copyright 1997-2014 JavaScript Kit. NO PART may be reproduced without author's permission.