Introducing jQuery

jQuery is one of the most innovative JavaScript libraries to come around. Using an Object-Oriented design pattern called the Fluent Interface, jQuery makes it possible to chain a sequence of function calls together to construct elaborate queries.

What does jQuery query? Usually, it is used to query the DOM tree.

A DOM (Document Object Model) tree is a data structure that defines T

the structure of a document—usually an HTML or XML document. The I document is presented as a tree structure, where the first element is the root. The API is standardized (see J

DOM is known for its complex object model. jQuery provides an API that is more compact and easier to use.

However, it can be used for more than just querying. It has a suite of AJAX tools, tools for event handling, glitzy effects, and some very useful utility functions. We will use a little bit of everything in this chapter.

[ _ â–  For more information on jQuery, see A fantastic

\\ \ book entitled Learning jQuery by Karl Swedberg and Jonathan Chaffer (Packt Publishing, 2007), has received rave reviews as well.

The first thing we will do with jQuery is use it to find a particular location in the HTML generated by Drupal's template, and then insert some additional HTML elements into the DOM. This is the way we will add a link.

Was this article helpful?

0 0

Post a comment