O'Reilly logo

Adding Ajax by Shelley Powers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other Libraries

There are a growing number of Ajax libraries available to use, from the simple to the complex. We'll briefly examine a few others to give you an idea of the wealth of useful functionality already created for your use.

Tip

A handy list of many of the Ajax libraries can be found at the eDevil weblog at http://edevil.wordpress.com/2005/11/14/javascript-libraries-roundup.

jQuery

One library that's quickly gaining popularity is jQuery, available at http://jquery.com. It's small, fast, and provides fundamental cross-browser methods to work with the DOM rather than higher-order effects.

Tip

The Interface library, found at http://interface.eyecon.ro, provides higher-order effects for jQuery, similar to what script.aculo.us provides for Prototype.

Unlike the other libraries, though, jQuery has only one object, the jQuery object. Unfortunately, jQuery uses the dollar sign shortcut, $( ), to reference this object. If you want to use jQuery with other libraries, especially Prototype, you have to use the jQuery.noConflict( ) function call at the very start of any script block to restore the other libraries back to their normal behavior. The literal jQuery object is then used as a way of accessing all of the functionality.

jQuery provides a high degree of chainability, which is the ability to chain function calls, one after another. This type of functionality requires that the library object methods return a reference to the object itself, which is used in the next method in the chain. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required