Wednesday, 19 April 2017

What is JQuery


jQuery is a lightweight JavaScript library that simplifies programming with JavaScript. 

According to jQuery.com
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.


Advantages of using jQuery over raw JavaScript
1. jQuery is cross-browser
2. JQuery is a lot more easy to use than raw JavaScript
3. JQuery is extensible
4. JQuery simplifies and has rich AJAX support
5. JQuery has large development community and many plugins.
6. Excellent documentation


What is the difference between jQuery 1.x and 2.x
         jQuery 1.x supports IE6/7/8, if we don't have to support IE6/7/8 then we can use jQuery 2.x.

         JQuery 2.x is smaller in size than jQuery 1.x.


Points to remember :
1. ready() function ensures that the DOM is fully loaded.
2. $ is a shortcut for jQuery.
3. All three of the following syntaxes are equivalent:
$( document ).ready( handler )
$().ready( handler ) (this is not recommended)