jQuery Cookbook Solutions and Examples for jQuery Developers
JQuery Cookbook Contents
As with most JQuery books I’ve read, this one starts out with some basics and then a chapter on “Selecting Elements with jQuery”. Chapter 3 is sort of a miscellany, and Chapter 4 covers some of the jQuery utilities that can be extremely useful yet which the casual jQuery user (such as myself) aren’t very familiar with, such as
There is a lot going in in Chapter 5, including several principles for optimizing your code, and what
$(this) really refers to in various contexts. Chapters 6, 7, 8, and 9 discuss Dimensions, Effects, and Events, and Advanced Events, respectively. Chapters 10 through 15 contain a higher proportion of those concrete examples, like enhancing forms, using jQuery plugins, and the JQuery UI library. Chapter 16 covers jQuery and Ajax, and it was the one I felt could have been longer. To be perfectly honest Chapters 16 and 17 seemed beyond my pay grade and I skipped them.
Highlights from the JQuery Cookbook
I had several “Aha!” moments when reading this book, starting early on on page 12. Here are three of my favorites:
- This one may seem obvious, but having done a lot of “View > Source”, I can say I haven’t seen it used often. Essentially, jQuery wizard Cody Lindley points out that if we put our scripts before the closing
</body>tag rather than in the head (which we know we should do from a speed optimization standpoint anyway) then there is no need to wrap everything in the
ready()event, making for even faster code. Sweet!
jQuery('html').addClass('hide-stuff');. Or, on page 280, use
document.write()to dynamically write in a link to a special style sheet. Delicious!
No comments yet…Be the first!
Comments are closed for this article.