Reputation: 59586
$ 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
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
Reputation: 28134
zepto also uses $, and is a lightweight alternative to jQuery:
In addition, it matches most of the jQuery API.
Upvotes: 1