Chapter 1. Introducing jQuery

 

This chapter covers

  • What exactly jQuery is and why you should use it
  • The unobtrusive JavaScript strategy
  • Choosing the right version of jQuery
  • Fundamental elements and concepts of jQuery

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.” How well this sentence from Bjarne Stroustrup, who designed and implemented C++, summarizes the sentiments about JavaScript. It, as well as several other languages (most notably PHP), was bemoaned as a “bad” language for several years. Then, something magical happened. Thanks to the rise of Ajax, the release of several libraries such as Prototype, Moo Tools, and jQuery, and the new, highly interactive web applications (which you might also have heard referred to as single-page applications), developers started understanding JavaScript’s potential. Today JavaScript is also one of the most ubiquitous languages thanks to Node.js, a platform that allows you to use it as a server-side language, and PhoneGap, a framework for creating hybrid mobile applications.

jQuery is a free (licensed under the MIT License), popular JavaScript library, created by John Resig in 2006, that’s designed to simplify the client-side scripting of HTML. As stated on the jQuery website,

1.1. Write less, do more

1.2. Unobtrusive JavaScript

1.3. Installing jQuery

1.4. How jQuery is structured

1.5. jQuery fundamentals

1.6. Summary