jQuery is a JavaScript library that allows web developers to add extra functionality to their websites. It is an open-source and is provided for free under the MIT license.

In just a few years, jQuery has emerged as a very popular JavaScript library that is used in web development.

To implement jQuery, a web developer simply has to reference this jQuery JavaScript file in HTML for a webpage. Some websites host their own local copy of jQuery, others simply refer to the library that is hosted by Google or jQuery server.

For example, a webpage can easily load the jQuery library by the following line, but it is written in the <head>section of HTML in something like this:

<script type="text/javascript"  src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>

Once the jQuery library is loaded, then a webpage can call any number of times the Query  function which is supported by the library.

Simple examples include modifying text, processing form data , moving elements in a page, and performing animations. jQuery can easily work with Ajax code and scripting languages, such as PHP and ASP, so that they can access data from a database.

Since jQuery runs in the client-side (not the web server), it can update the information in a webpage in realtime, which does not even require reloading the page.

A very common example is “autocomplete,” in which a search form automatically starts displaying common searches as soon as you type your query.

At the same time, its free license is another important reason why jQuery has become so popular. At the same time, its cross-browser compatibility is also a reason for its popularity.

Since each browser renders HTMLCSS , and JavaScript separately, it is very difficult in favor of a web developer to make a website appear the same in all browsers.

So instead of writing custom functions for each browser, a web developer can use a single jQuery function that will work in all browsers such as Chrome, Safari, Firefox, and Internet Explorer.

This multi-browser support has attracted a lot of developers, so that they can switch from standard JavaScript to jQuery, as it simplifies the entire coding process.

« Back to Wiki Index