So, why jQuery is so popular? As a brief summary, JQuery is easy to learn, has good documentation, has an enhusiastic community behind it, has successful cross-browser compatibility, is pluggable and has tons of plugins. Continue to read to learn more.
The Reasons Behind jQuery Popularity
JQuery is easy to learn It has a very low learning curve. Besides having a perfect documentation, the philosopy behind JQuery is simply great! You just select a dom element and perform some task on it. Its very simple to understand. Just check the folllowing example. It finds the "div"s, adds (css) class to them and shows them slowly. Simple to code, simple to understand.
JQuery is simple Considering the example code above, jQuery objects are chainable. JQuery objects return other jQuery objects and it is possible to perform additional operations in a chain. As you clearly notice, jQuery methods loop through all DOM elements automatically and apply the desired method. There is no need to iterate every object one by one.
JQuery has a clever core library JQuery core library is small and omits fairly common functionalities. Any additional required functionality is added with plugins and there are tons of jQuery plugins out there. So, in jQuery there are several different ways to do one thing. You can choose the one that suits your needs best.
JQuery is pluggable The reason of why there are so much jQuery plugins is that jQuery is designed to be pluggable. The $ method of jQuery just returns a series of DOM objects. A developer can easily extend the Jquery $ method by writing his own selector or by addding a new operation . This advantage makes jQuery plugins usually much shorter than their counterparts.
JQuery works in most browsers Cross-browser compatibility of jQuery is very successful. Most of the code you write will run exactly the same on all the major browsers.
Big companies supports JQuery and also use it Google, Mozilla, Wikipedia, Netflix, Technorati, Dell, Digg, Drupal and so on. It is also supported by IBM and Microsoft.
People use and love JQuery JQuery has a massive market share. Lots of people not only use it but also write tutorials, share their code, make plugins.
JQuery UI JQuery has a very strong official UI library. It is separate from the core library but sits on top of jQuery perfectly. UI capabilities might not be stronger than some other libraries such as ExtJs but it's getting better.
JQuery Sizzle JQuery core library is 31 KB when minified and g-zipped. It is small but you have a smaller alternative: Sizzle. Sizzle library is 4 KB and it's simplified just to be used for css selection.
To sum up, some JQuery features can be listed as:
- It's fast.
- Easy to learn, easy to use
- Good documentation
- Community : Tons of tutorials and resources
- Widespread Adoption : Google, Mozilla, Wordpress, Drupal, IBM, Microsoft use and support it.
- Cross-browser compatibility
- Full support to CSS3 selector specification
- Useful utility functions
- Tons of plugins, easy to extend
- JQuery UI library !!!
- JQuery Sizzle : just 4KB.
Each statistic belongs to a different research. The figures might differ but each of them shows how JQuery dominates the market.
Released in January 2006 by John Resig.
JQuery name was chosen over JSelect by John Resig because all the domain names had been taken already.
First stable release is in August 2006 and the latest release is 1.6.2 as of August 2011.
Wikipedia JQuery Article
This article is also introduced in DZone.