Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

jQuery Dollar

497 sites Security covered
View on drupal.org

This module allows developers to use the "$" symbol to access the jQuery library directly in the global namespace. It's a convenience for those who find the default Drupal method of accessing jQuery cumbersome.

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
8 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Release date
2.0.1 Stable Nov 1, 2025