Current

This document is valid for the current version of Plone.

jQuery

by Plone Documentation Team last modified Feb 26, 2011 09:13 PM
Contributors: Mikko Ohtamma, Martin Aspeli, Kamon Ayeva, Israel Saeta Pérez

jQuery has been part of Plone since 3.1, and should be used for DOM selection, traversal and manipulation; event binding and handling; and AJAX.

Using jQuery

Plone components should not depend on the "$" alias for jQuery. Also, the "jq" alias is deprecated.
If you wish to use the "$" alias in your code, there are a couple of common conventions that will allow you to do so without making global changes:

(function($) {
    /* some code that uses $ */
}(jQuery));

or, make use of the fact that jQuery passes itself to the document ready handler:

jQuery( function($) {
    /* some code that uses $ */
});