Saturday, February 21, 2015

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)

Browser Compatibility

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

BrowserWorks WithKnown Issues With
Internet Explorer6.0 and greater1.0 through 5.x
Safari3 and greater1.0 through 2.1
Chrome1 and greaterN/A
Firefox2 and greater1.0.x
Opera9 and greater1.0 through 8.x

Downloading jQuery

jQuery comes in two versions:
  1. Development
  2. 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></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>

No comments:

Post a Comment