Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Foreword When I first started work on building jQuery, back in 2005, I had a simple goal in mind: I wanted to be able to write a web application and have it work in all the major browsers--without further tinkering and bug fixing. It was a couple of months before I had a set of utilities that were stable enough to achieve that goal for my personal use. I thought I was relatively done at this point; little did I know that my work was just beginning. Since those simple beginnings, jQuery has grown and adapted as new users use the library for their projects. This has proven to be the most challenging part of developing a JavaScript library; while it is quite easy to build a library that'll work for yourself or a specific application, it becomes incredibly challenging to develop a library that'll work in as many environments as possible (old browsers, legacy web pages, and strange markup abound). Surprisingly, even as jQuery has adapted to handle more use cases, most of the original API has stayed intact. One thing I find particularly interesting is to see how developers use jQuery and make it their own. As someone with a background in computer science, I find it quite sur- prising that so many designers and nonprogrammers find jQuery to be compelling. Seeing how they interact with the library has given me a better appreciation of simple API design. Additionally, seeing many advanced programmers take jQuery and develop large, complex applications with it has been quite illuminating. The best part of all of this, though, is the ability to learn from everyone who uses the library. A side benefit of using jQuery is its extensible plugin structure. When I first developed jQuery, I was sure to include some simple ways for developers to extend the API that it provided. This has blossomed into a large and varied community of plugins, encom- passing a whole ecosystem of applications, developers, and use cases. Much of jQuery's growth has been fueled by this community--without it, the library wouldn't be where it is today, so I'm glad that there are chapters dedicated to some of the most interesting plugins and what you can do with them. One of the best ways to expand your precon- ceived notion of what you can do with jQuery is to learn and use code from the jQuery plugin community. xi