David Sills's muse is fueled by Bach, Beethoven, and Brahms (and Berlioz and Boulez). He has no life, which comports well with the über-geekitude to which he aspires. He reads and writes fitfully in English, Spanish, French, German, Italian (mostly medieval), C, VB, Perl.... Oh, and Java and XSLT, lots and lots of Java and XSLT. Trained somewhere in darkest Central America, he works today at DataSource, Inc., on the product team for the CASE tool Abri. David has posted 9 posts at DZone. View Full User Profile

jQuery in Action

09.08.2008
| 25666 views |
  • submit to reddit
Published by: Manning 
ISBN: 1933988355

Reviewer Ratings

Relevance:
5

Readability:
5

Overall:
5

Buy it now

One Minute Bottom Line

This is an excellent work, a worthy successor to others in Manning's "in Action" series. It is highly readable and chock-full of working code. The Lab pages are a marvellous way to explore this library, which should become an important part of every web developer's arsenal. Five stars all 'round!

Review

Chapter 1 - Introducing jQuery

As the title suggests, this chapter introduces the main elements that will be carried through the book: the jQuery wrapper, utility functions available in jQuery, the document ready handler, DOM manipulation, extending jQuery, and using jQuery with other libraries. The concept of Unobtrusive JavaScript is also briefly touched upon.

Chapter 2 -Creating the wrapped element set

Before you can work on elements of the DOM, you have to find the ones you want to work on. The jQuery library uses and significantly extends the standard CSS selectors to enable the user to trivially select whatever elements they wish, based upon a wide variety of attributes, relationships, and more. jQuery's concept of chaining method calls (returning the wrapped set at the end of each method so that the next method can be called directly on the return value from this one) is clarified with many examples.

Chapter 3 -Bringing pages to life with jQuery

Once you have your elements, what then to do with them? jQuery shines in its ability to change element properties and attributes, to alter element styling, to set element content, even to retrieve form element values! This last is perhaps better handled by the Form Plugin to be discussed in chapter 9, but some basic functionality is provided even in the main library.

Chapter 4 -Events are where it happens!

In working with JavaScript, it is critical to understand many details of the brower event models. These vary from browser to browser, even varying in implementation details where they do not in API. jQuery has its own event model that can be of great value in guaranteeing consistent cross-browser behavior in response to events. Of course, it is based around the lowest common denominator, but it provides most of what is really needed by writers of JavaScript.

Chapter 5 - Sprucing up with animations and effects

We are a long way from the days of flashing fonts and long shadows, but there is still a lot to be gained by using simple animations that clarify what exactly is taking place on screen. jQuery provides an easy-to-use selection of such animations, including showing and hiding elements, fading elements, sliding elements up and down, and so forth. Custom animations are also quite simple to add.

Chapter 6 - jQuery utility functions

Working with DOM elements is not the only place the jQuery library provides significant functionality. There are some times when, like it as not, we must know what user agent (browser) we are working with. jQuery makes this and other such non-cross-browser queries far simpler than they would be without it. In addition, the library includes utility functions operating on strings and JavaScript arrays and allows for the dynamic loading of more scripts.

Chapter 7 - Extending jQuery with custom plugins

Reusable functionality can usefully be implemented as plugins to the jQuery library. This involves conforming to some basic naming practices; in addition, best practices for implementing jQuery plugins so that they can be used in an environment where jQuery and other libraries are used together are presented. The examples supplied in this chapter are particularly well-taken.

Chapter 8 - Talk to the server with Ajax

Of course, when we think jQuery, we inevitably think: Ajax! And jQuery's Ajaxian capabilities are impressive indeed. After a brief introduction to Ajax basics, retrieving and submitting data via GET and POST requests are covered, along with the ability to completely control all aspects of the Ajax request.

Chapter 9 - Prominent, powerful, and practical plugins

In chapter 7, we saw how to create custom plugins to the jQuery library. Here we learn about some of the "official" plugins developed and made available publicly for jQuery: the Form Plugin, the Dimensions Plugin, the Live Query Plugin, and the UI Plugin. These allow users to employ safe, well-tested code to perform functions not necessarily appropriate for the main jQuery library, but just as essential when they are needed!

Appendix - JavaScript that you need to know but might not!

This appendix would alone justify the purchase of this book. It contains a neat summation of "things you wanted to know but were afraid to ask" about JavaScript. Reading it is essential for those whose experience with the language exceeds their theoretical understanding of how it works.

Published at DZone with permission of its author, David Sills.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)