Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! 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)!

jquery_dollar

476 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
7 months ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
2.0.1 Stable Nov 1, 2025