Archive for the ‘Book Review’ Category
Review of jQuery 1.4 by Karl Swedberg and Jonathon Chaffer
March 16, 2010I recently read through the newest revision of Karl and Jonathon’s amazing jQuery reference manual, which has just been updated for the latest release of the jQuery library itself. Even though it’s a reference manual used to refer to specific methods or properties of the library rather than a teaching book that takes the reader on a journey through the API I still wanted to read through it in its entirety in order to give it a balanced review and to see how much additional information it provided. I’m already fairly competent in using jQuery so I wanted to see if there was anything new it could show me. It did – there were subtle aspects to a number of methods that I had never used before, and with the new additions to the guide added for jQuery 1.4, there was actually a lot I took away from this book.
The first chapter served as a very good general introduction to jQuery and what the library is capable of. The whole chapter is dedicated to an interactive example that uses a wide variety of different jQuery methods and functionality, and the accompanying text gradually picks apart all of the code to show what it does. The example is excellent for those new to jQuery and was a very good way to start the book.
After the initial example-based chapter the book switches tone to more of a reference style guide; chapter 2 is a very detailed, quite lengthy chapter that covers all of the different types of selectors that can be used to select elements from the DOM. Many different selectors, including advanced ones like the different types of attribute selectors are covered.
Remaining chapters look at the different types of methods that are exposed by the library; there is a chapter dedicated to DOM traversal methods, another that looks at AJAX-related methods, etc. Helpfully, the book is structured similarly to the online documentation so readers should be able to easily find the method they require information about without too much difficulty.
Towards the end of the book there are chapters that look at the miscellaneous methods such as .grep(), .unique(), etc which don’t fit neatly into any of the other categories, and the different properties of the jQuery object that can give us extra information about the environment that the library is executing in such as the .browser properties. These last chapters will be of huge importance to many developers that are familiar with some of the more common methods, but less familiar with some of these lesser-used methods and properties.
There is also a chapter dedicated to the construction of jQuery plugins; the authors didn’t have to include an entire chapter on this topic as it is sometimes seen as beyond the scope of general jQuery usage. They could have just included some basic information under the miscellaneous chapter perhaps, but they didn’t, they provided a whole chapter to it because the topic deserves a whole chapter. It’s a relatively short chapter, and the example plugins are very light, but it covers all of the essentials for plugin development such as the standard conventions, the object method and global functions, so this chapter adds a lot of value.
The book also features some potentially very useful appendices including lists of useful tools for JS developers such as code minifiers and browser development tools, information about where to find useful JavaScript, (X)HTML and CSS references as well as a complete alphabetical listing of every jQuery method and property.
Overall, I found this an excellent reference book for developers of all levels and would recommend it to anyone that was serious about jQuery development. Bear in mind that it is a reference manual opposed to a recipe-style example-based book, so the style is very concise and sometimes dry. Personally I think this was a good thing as it allowed the book to remain focused on the core topics without going off on a tangent about implementational specifics that the reader may never encounter. It’s highly accessible, very information-heavy and literally covers every single method and property found in the library. This book will stay on my desktop (my real, actual desk) for some time to come and will remain my first point of contact from now on when looking up any method of the library.
My one complaint is that some of the appendix items from previous versions of the book seem to have been removed; for example, there is an information box in one chapter which states ‘An in-depth discussion of closures can be found in Appendix C of the book Learning jQuery 1.3.’ I’m sure many people buying the 1.4 version of the book won’t already have the previous edition so this is not helpful in any way. Leaving this non-essential but related information in the book would have been far better. Sometimes however, due to the limits that are placed on page count by publishers, old, less-related information has to be removed. It’s not a massive complaint, and I can understand why the authors may have had to remove these extras to make room for information relating to all the cool new functionality of jQuery, but I think the book would have benefited from retaining this information if at all possible.
Review of jQuery 1.3 with PHP by Kae Verens
January 31, 2010jQuery 1.3 with PHP by Kae Varens is a great book that shows you how to interface jQuery with PHP. It’s different from any other web development book I’ve read because it approaches things from the opposite perspective that I personally am used to – from the server to the client. It’s aimed at competent PHP developers that want to learn how to use jQuery. Strictly speaking I’m outside of the scope of who the book is aimed at, but fortunately I just enough PHP to follow along with the examples and know roughly what is happening in the server-side code. It is made clear very early on who the book is aimed at.
One thing that I really liked about this book was that as well as the strong focus on jQuery throughout (as you’d expect) the author also included not just one, but several different examples of using jQuery UI in conjunction with PHP. jQuery UI is the official UI library for jQuery so I think it’s important that it should be covered in this kind of book, even if only briefly.
The book is broken down into the following chapters:
Chapter 1 eases you into the book with sections on what jQuery is, why you should be using it and how it integrates with PHP. Some popular web applications that use jQuery are looked at and the author shows how to set up a directory structure so that the examples in the book can be replicated.
Chapter 2 covers some quick tips that server-side developers can use in order to help bridge the gap between the client and the server. Examples include how to make select boxes dynamically load options when required, contextual help tips, and inline editing of a page’s content.
Chapter 3 looks at the tabs and accordion widgets from jQuery UI and shows not only how to load their contents dynamically, but also how to create them on the fly with the server. This is a very thorough and detailed chapter and I really liked the code examples here.
Chapter 4 focuses on forms and form validation; it shows how to use the jQuery validation plugin in order to perform some validation on the client before involving the server (such as checking for empty fields which are required), and how to complete the validation on the server. Another code examples shows how to easily create an awesome auto-complete text-field.
Chapter 5 is another very thorough and in-depth chapter dominated by code examples; it shows how to create a file management system that allows for creating, moving and deleting directories on the server and uploading, moving and deleting files. This was probably my favourite chapter of the book.
Chapter 6 shows you how to create an entire calendar application that allows you to add, delete and move events and how recurring events can be handled. This is a great practical chapter that uses some interesting plugins including the jquery-week-calendar and the jQuery UI dialog. The example really highlights how to make these plugins work with server efficiently.
Chapter 7 covers image manipulation such as cropping, resizing and rotating. Jorn Zaefferer’s treeview plugin is used in conjunction with some of the file management app created in chapter 5 to show the images available, while the actual manipulations are performed with the ImageMagick PECL extension.
Chapter 8 looks at the client-side heavy jQuery UI interaction helper sortable; so far the jQuery UI components the book has looked at have all been UI widgets so it’s great that this is included as well. Drag and drop, a very client-side oriented task, is looked at in detail and there is probably less server-side code in this chapter than in any other, which must be incredibly useful for those more used to working with the server.
Chapter 9 looks at displaying large sets of tabular data efficiently and uses the dataTables jQuery plugin to allow pagination, sorting, filtering and column re-ordering. There are some interesting (for me) server-side concepts in this example such as caching and how to load data is small chunks, but a server-side developer would probably know this already. The client-side code examples were quite extensive as well though and would help server-side developers use the dataTable plugin effectively.
The final chapter, chapter 10 looks at a series of examples that show how client-side code can be optimised to improve the user experience; it’s a fast paced chapter with a lot of small examples and contains some real gems of information.
Overall this is a great book with very thorough and well-explained examples and plenty of code that the average server-side developer could take away and reuse. As a front-end developer I’m completely the opposite of who the book is aimed at but it was clear that the descriptions of using jQuery would be of value to PHP developers.
Review of jQuery Enlightenment by Cody Lindley
January 3, 2010jQuery Enlightenment is an e-book in PDF format written by Cody Lindley, an official jQuery evangelist since 2008 and talented front-end developer with over 12 years experience in the field.
The book is aimed at several different types of developer; the first is someone that knows the basics of jQuery and is ready to take their skills to an intermediate or advanced level. The second type of developer is someone that is proficient with another JavaScript library and needs to quickly learn how to transfer their skills to the world of jQuery. The book is not recommended for people that have never used jQuery or any other JavaScript library before because it describes some advanced concepts which may hinder novices in learning the basics. That’s not to say that a novice couldn’t pick up this book and learn jQuery from scratch, but generally it’s best to master the basics first.
The PDF format is excellent for this type of book because extra and supplemental information can be properly hyper-linked to. One of the things I loved about this book was that virtually all of the practical examples are hosted on JSBin so while reading you can instantly see the effect of code without having to download source files – everything is ready and waiting for you to experiment with.
Another thing I really found useful with this book was the level of detail it goes into when explaining the different methods found in jQuery, it even informs you how some of the methods are executed by jQuery and this gives a much fuller understanding of how the library works and therefore how to use it more effectively.
I found the book very easy to read, with a strong focus on practical code interspersed with succinct descriptions. There wasn’t too much theory or too many complex examples – the perfect blend of theory and practice. I would consider myself a fairly experienced jQuery developer, having used the library for several years, but there was still a lot I learnt from reading this book. It was really great for going back and filling in the gaps between what I’ve learnt from just playing with code, stuff I’d simply not learnt because I’d never needed to use it.
The book is divided into the following chapters:
- 1: Core jQuery
- Chapter one introduces the concept of jQuery and looks at when to include the script files, using hosted versions of the library and checking which version of the library is in use. It also covers a range of other foundation-laying subjects including the different ways of executing jQuery code, chaining, destructive vs non-destructive methods, the this keyword, aliasing the jQuery object and different wrapper-set concepts.
- 2: Selecting
- Chapter two covers advanced aspects of element selecting such as custom filters, creating custom filters, the is() method and how to escape characters used when selecting. Other topics such as stacking and nesting filters, the nth-child filter and using regular expressions to select attribute values are also covered here.
- 3: Traversing
- Chapter three looks at the different ways that new elements can be navigated to through the DOM after selection. The subtle differences between the find() and filter() methods, custom functions passed to the filter() method and how to traverse the DOM using CSS expressions with traversal methods are some of the subjects discussed here.
- 4: Manipulation
- Chapter four focuses on how raw HTML can be created, manipulated and added to the DOM. The index(), text(), contents() and remove() methods are looked at in detail and advanced techniques such as removing particular characters from an element’s content by regular expression are also discussed.
- 5: HTML forms
- Chapter five is dedicated entirely to working with HTML form elements with jQuery and covers topics including disabling and enabling elements, checking and un-checking radio and checkbox elements getting or setting the values of different form elements. The different ways of selecting form elements are looked at too.
- 6: Events
- Chapter 6 covers everything about events a jQuery developer could want to know such as working with the bind() and unbind() methods, invoking events and how to share a function between several event handlers. Other key event topics such as event namespacing, event delegation and working with the normalized event object’s native methods (such as preventDefault() are also discussed in detail.
- 7: jQuery and the browser
- This relatively short chapter looks at two ways of dealing with common tasks in the browser itself – disabling right-click context menus and handling scrolling in the browser window.
- 8: Plugins
- Chapter 8 looks at all aspects of plugins from how to construct one from scratch and best practices when working with them, to how they attach to the jquery.fn object to become new jQuery methods. Other less well known aspects of plugin development such as invoking plugins programmatically without using a collection of selected elements are also covered in detail.
- 9: Performance best practices
- Chapter 9 is a collection of tips and best practices to use to ensure that your jQuery–powered interfaces remain responsive. This chapter is filled with information that intermediate to advanced developers should be considering whenever they write jQuery including selector performance, minimising DOM changes, method and selector optimization and when to use native JavaScript methods instead of jQuery functionality.
- 10: Effects
- Chapter eleven is concerned with the different jQuery effects and how best to leverage them. Subjects of this chapter include determining which elements are currently being animated using the :animated filter, using show(), hide() and toggle() logic without animations and the difference between sequential and non-sequential animations.
- 11: AJAX
- Chapter 11 looks at the base ajax() method from which all other AJAX methods are derived and looks in detail at cross-domain requests with JSONP and how to control caching of XHR requests.
- 12: Miscellaneous concepts
- The final chapter is a mixed bag of concepts giving some theory but mostly practical recipes for achieving different things with jQuery such as storing data on DOM elements, embedding flash objects with a plugin, pre-loading assets (images and XHR) and adding new functions to the jQuery namespace.
Summary
Overall this would be a great addition to any jQuery developer’s library and I’d thoroughly recommend it for all but the most advanced developers. Its easy readability combined with its detailed examples make this a book that I’ll repeatedly turn to for reference.

YUI 2.8
The beginner to advanced-level guide for understanding the YUI library£46.98£41.33!read more
jQuery UI 1.7
Learn the latest version of jQuery UI with a detailed, step-by-step approach£29.99£23.79!Read more
jQuery UI 1.6
If you need to use jQuery 1.2, this book will show you how to leverage jQuery UI 1.6£29.99£23.79!Read more
Learning YUI
Discover how to use version 2 of the YUI to it's full potential£27.99£23.79!Read more

