What is jQuery?

jQuery is not a language but it is a well written code. jQuery is a set of JavaScript libraries that have been designed specifically to simplify HTML document traversing, animation, event handling, and Ajax interactions

There are many other JavaScript code libraries such as MooTools, but jQuery has become the most popular because it is so easy to use

Prerequisite
To start work on jQuery, you should be aware of the basics of JavaScript, HTML and CSS

License
jQuery is free, open source software Dual-licensed under the MIT License and the GNU General Public License. Microsoft has integrated jQuery officially into its IDE Visual Studio 2010 and jQuery intellisense is available in Visual Studio 2010 and higher version now.

Why use jQuery?

  • It helps to improve the performance of the application.
  • It simplifies the task of creating highly responsive web pages.
  • It helps to develop most browser compatible web page as it works across modern browsers.
  • It helps to implement UI related critical functionality without writing hundreds of lines of codes.
  • It abstracts away browser-specific features, allowing you to concentrate on design.
  • It leverages your existing knowledge of CSS
  • It performs multiple operations on a set of elements with one line of code (known as statement chaining)
  • Is extensible (so you can use third-party-plug-ins to perform specialized tasks or write your own)

Why use jQuery?

Currently compatible with modern version of all the main browsers in use today

Browser Works With Known Issues With
Internet Explorer 6.0 and greater 1.0 through 5.x
Safari 3 and greater 1.0 through 2.1
Chrome 1 and greater N/A
Firefox 2 and greater 1.0.x
Opera 9 and greater 1.0 through 8.x

Downloading jQuery

jQuery comes in two versions:
  • Development
  • Production (which is compressed and minified)
jQuery file can be downloaded from jQuery Official website.

Typically, you download both versions and then use each one for its intended purpose

How to use jQuery?

Use as local file:

<script src="jquery-1.6.1.min.js" type="text/javascript"></script>
Ideally, this markup is kept in under head tag of your web page, however you are free to keep anywhere you want.

Loading jQuery from CDN:
CDN Stands for Content Distribution Network or also called Content Delivery Network is a group of computers placed at various points connected with network containing copies of data files to maximize bandwidth in accessing the data. In CDN, a client accesses a copy of data nearer to the client location rather than all clients accessing from the one particular server. This helps to achieve better performance of data retrieval by client.

There are two leading CDNs available that host jQuery files: Microsoft & Google

<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>