Which Javascript library other than jQuery uses $?

$ is not a function is a common error message newbies encounter when trying to use JQuery in Drupal 7.

The explanation is that the usage of $ is disabled in Drupal to avoid conflicts with other libraries. But which other library is using $?

Upvotes: 0

Views: 231

Answers (3)

Tadeck
Tadeck

Reputation: 137380

At least two major ones:

It is probably because using one char for most commonly used function saves a lot of time. And due to some restrictions for characters in variable name in JavaScript there are actually two candidates for such one-char names: $ and _ (_ is used often for eg. gettext functions or throw-away variables). Thus I would rather expect that if some framework has some shortcut function with one char name, it is probably $.

Upvotes: 4

Christophe
Christophe

Reputation: 28134

zepto also uses $, and is a lightweight alternative to jQuery:

http://zeptojs.com/

In addition, it matches most of the jQuery API.

Upvotes: 1

Nanne
Nanne

Reputation: 64409

One of the common problems is several different versions of JQuery itself, though I'm not sure that is the reason in Drupal. Another possibility is Mootools

Upvotes: 2

Related Questions