Extending jQuery cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

Foreword

published book

Since jQuery’s debut in 2006, it has grown into the most popular JavaScript library for managing and enhancing HTML documents. jQuery’s cross-browser design allows developers to focus on building websites instead of puzzling out browser peculiarities. In 2013, more than one-half of the top million websites (measured by visitor traffic) use jQuery. Similarly, the jQuery UI library, which builds on jQuery, is the most popular source of UI widgets.

With that popularity comes the temptation for the jQuery team to add features so that nearly any problem encountered by a developer can be solved with the incantation of a jQuery method. Yet every feature added to the core code of jQuery means more bytes of JavaScript for website visitors to download, whether or not a feature is used in that site’s development. Such a large monolithic library would degrade performance just for the convenience of web development, which isn’t a good trade-off.

To combat the scourge of code bloat, jQuery’s philosophy is to put only the most common functionality in the library and provide a foundation developers can extend. An incredible ecosystem of jQuery plugins has grown over the years, driven by each developer’s need to scratch a particular itch and their generosity in sharing code with the wider jQuery community. Much of jQuery’s success can be attributed to this ethos and the team fosters it through sites like plugins.jquery.com.

Keith Wood is well suited to be your guide through Extending jQuery. He’s been a regular fixture in the jQuery Forum and a top contributor for several years, providing high-quality answers to the real-life problems developers encounter. He’s also earned his street cred by developing several popular jQuery plugins. As a result, Keith has a practitioner’s understanding of jQuery extensions combined with an instructor’s intuition about which jQuery topics deserve a deep explanation rather than a passing mention.

This book delves into just about every facet of extending jQuery’s functionality, whether for personal needs or professional profit. The best-known type of extension is the basic jQuery plugin that extends jQuery Core methods, but the book gives equal time to jQuery UI widget-based plugins that are often a better foundation for visually oriented extensions. Detailed documentation on the jQuery UI widget factory is scarce, which makes these chapters all the more valuable.

I’m especially pleased that Keith dedicates some time to the topics of unit tests. Having a set of thorough unit tests seems like needless extra work, right up until the point a few months later where an innocuous change to a plugin causes the entire web team hours of debugging on a live site while user complaints flood in. Unit tests can’t find all bugs, but they act as a sanity check and prevent obvious regressions that manual testing by an impatient developer tends to miss.

Whatever your reason for learning about jQuery extensions, please consider contributing your work back to the community as open source if it seems that others might benefit from it. This is a natural fit with jQuery’s own philosophy. Sharing your knowledge with others not only helps them, but it comes back to you in professional recognition.

DAVE METHVIN PRESIDENT, JQUERY FOUNDATION

Get Extending jQuery
buy ebook for  $35.99 $25.19
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage