HTML and CSS Reference
In-Depth Information
jQuery is a JavaScript library designed to simplify the process of writing JavaScript applic-
ations within web browsers.
Due to the document-centric nature of web pages, JavaScript is routinely responsible for se-
lecting elements within the document (the internal representation of a document inside the
browser is referred to as the Document Object Model), manipulating these elements, or re-
acting to events triggered by these elements. JavaScript natively supports this functionality
through the Document Object Model API, which is also included in the HTML5 specific-
ation. jQuery essentially provides an elegant wrapper around the Document Object Model
The heart of jQuery is a selector engine. jQuery accepts selection criteria based on CSS style
selectors, and returns a set of elements from the document that meet these criteria. Once a
set of elements has been selected, jQuery provides a wide array of functions to perform op-
erations on these elements, or to attach event listeners to them.
Although jQuery cannot do anything JavaScript could not do with the native DOM API, it
has become enormously popular for several reasons:
• It removes the pain of dealing with quirks between different browsers.
• It provides a rich and succinct syntax that is seen by most as a vast improvement over the
Document Object Model API.
• It is simple to write custom plugins for jQuery, and therefore it can be extended to meet
specific needs.
• There are a wide range of open source plugins available for jQuery, including a popular UI
toolkit called jQuery UI.
There are a number of competitors to jQuery such as Dojo and Prototype, but jQuery has
obtained a critical mass in the market place and is almost a de-facto standard for web applic-
Search WWH ::

Custom Search