jQuery is a
JavaScript library developed by John Resig. It basically simplifies JavaScript
and AJAX programming. We must be familiar about what JavaScript is and how it
is used. In one line, JavaScript is a cross-platform, object-based scripting
language developed by Netscape. It is used to add interactivity and dynamic
content to web pages. And AJAX is the short form of Asynchronous JavaScript and
XML. It is basically a technique used for handling external data asynchronously
through JavaScript, without the requirement of reloading an entire page. jQuery
emphasizes the interaction between JavaScript and HTML.
Basics of jQuery
jQuery contains all the common DOM, event, effects, and Ajax functions in a single JavaScript file. Unlike other libraries which normally operate
by introducing new classes and extending the built-in JavaScript classes,
jQuery, rather than extending classes, provides a new class called jQuery. It
acts as a wrapper around objects for providing extended operations upon those
objects. For making use of jQuery, the particular JavaScript file (i.e. the
jQuery file) needs to be included in the file which is going to use the jQuery
functionality.
Advantages
The benefits of using jQuery are:
It helps in enhancing JavaScript without adding a lot of
burden to learn some new syntax or way of coding. It basically uses the
knowledge what one already has on JavaScript.
jQuery helps in keeping the code simple, clear, readable and
reusable.
It is no longer required to write a bunch of repetitious and
tedious loops and DOM scripting library calls. Using jQuery, it is possible to
get right to the point and act on it using the fewest possible lines of code.
jQuery's chainable methods allow a programmer to write much
more compact code than other JavaScript libraries.