I was approached by Packt Publishing and asked to review their new book jQuery Plugin Development Beginner’s Guide by author Giulio Bai, so with hopes of at least learning something new I picked it up and here’s what I found.
Learn the basic concepts
The first few chapters gives a quick introduction to the wonderful world of jQuery. By experimenting with other already well known plugins (like Validation by Jörn Zaefferer) you are introduced to some of the basic concepts of jQuery plugins. You’ll learn the difference between method type plugins and function type plugins, and how to make your plugins chainable with the standard jQuery functions. Most importantly you will learn how to create your very own plugin, complete with options handling, from scratch. For an aspiring jQuery plugin developer these chapters serves as a nice complement to the official jQuery plugin authoring documentation.
Master different kinds of plugins
The main part of the book deals with the many different kinds of plugins that you can create; media plugins, form plugins, UI plugins, animation plugins, utility plugins, etc. You get some basic coverage of how to create plugins of each type. For instance you will learn how to create your own nifty little HTML5 based MP3-player. The actual usefulness of the different implementations varies somewhat, but the real strength in these chapters are really all the small things that you learn along the way as each chapter attempts to take you a little bit further, making your code cleaner and cleaner.
The book is very well organized and each chapter pretty much follows the same structure. You get a set of “do it yourself” style instructions that are very easy to follow, and even though all you might be doing is copying and pasting code you will still get the feeling that you are building something yourself. I really like that you get to work with real code right away, because using jQuery is really all about doing things. For me personally the best learning practice has always been “learn by doing”, and from that perspective the books does a really good job, but it also encourages other ways of learning. Every exercise is followed by a “What just happened?” section that explains what you just did, also at the end of each chapter you will find a “Pop Quiz” and a “Summary” that makes you reflect on the things you have learned.
To sum it all up, if you want to learn how to write your own jQuery plugins or just learn more about working with jQuery this book definitely fits that purpose and works as a very well structured complement to the official online documentation for jQuery. For more seasoned jQuery developers there’s also quite a few nice tips and tricks that you may not already know of.