This lesson 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,
jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
Although you might find this claim a bit self-promotional or presumptuous, it asserts nothing but the truth. jQuery has really changed the way millions of developers and designers write their code. Its use is so widespread that, according to the latest BuiltWith statistics (as of April 2015), jQuery is used by 63% of the top million. The previously cited Moo Tools library, its nearest competitor, has a usage of just 3%, while Prototype has a mere 2.5%.
jQuery is used by some of the most important companies and websites in the world, such as Microsoft, Amazon, Dell, Etsy, Netflix, Best Buy, Instagram, Fox News, GoDaddy, and many more. If you had any doubts about jQuery, this data should convince you that it’s a stable and reliable library that you can use in your projects.
This app covers many aspects of the library starting from basic concepts, like selectors and the methods to traverse the Document Object Model (DOM), to more advanced ones, like extending the functionalities (creating plugins), improving the performances of your code, and testing. It assumes you have a minimal knowledge of JavaScript. If you need a refresher, take a look at the appendix. If you’re unfamiliar with the language, you may find this text too tough, so we encourage you to study it and then come back. We’ll wait here.
Are you back? Glad to see you again! Let’s start from the beginning—that is, discussing what jQuery has to offer you and how it can help you in your web development process.
Leave a Reply