Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

jquery_dollar

483 sites Security covered
View on drupal.org

What?

This module allows developers to use $ to access the jQuery library in the global namespace instead of calling jQuery explicitly or passing $ as a parameter into your closures.

Why?

Originally, I was annoyed about the change in Drupal 7 (http://drupal.org/node/1407256) that caused Drupal to noconflict() jQuery by default. This was a code migration headache and an inconvenience when it came to using most snippets of jQuery found in example documentation or in snippets on the web.

Now, as I have come to better understand javascript architecture, the value in noconflicting jQuery seems clear, and the only genuine purpose I can give to this module is as a convenience to those who are still annoyed by the minor hoops required to use jQuery "normally".

Should I?

You're OK to use this module if:
1. You don't expect to use any other javascript library that uses the global $ (Prototype, MooTools, maybe some others).
2. You don't need to use different versions of jQuery per page or multiple versions of jQuery throughout your site.

In general this module goes against the now fairly established javascript conventions in Drupal. If those conventions annoy you and you prefer easier access to the $, more power to you. I've been there.

How?

How does it work? The module implements hook_js_alter and injects a js file that re-assigns the global $ to point to jQuery. This happens immediately after misc/drupal.js (drupal.init.js in D8) is loaded (which is where jQuery.noConflict is called) so any other javascript in the site can utilize it, even other scripts that gets added in hook_js_alter should be fine.

Special thanks to sun for collaboration and lending expertise.

Activity

Total releases
1
First release
Nov 2025
Latest release
5 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.0.1 Stable Nov 1, 2025