Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with $ as jQuery namespace #5

Closed
criz opened this issue Dec 1, 2014 · 3 comments
Closed

Issue with $ as jQuery namespace #5

criz opened this issue Dec 1, 2014 · 3 comments

Comments

@criz
Copy link
Contributor

criz commented Dec 1, 2014

When implementing the library in Drupal I get the following error:

TypeError: $ is not a function

See http://stackoverflow.com/a/23739123.

"Drupal 7 provides jQuery in the no-conflict mode, which means that $ is not the jQuery object/namespace. This should not be an issue with properly written jQuery plugins that follow jQuery's plugins authoring documentation."

Please note that just wrapping the code in a anonymous function didn't fix it for me. Adding var $=jQuery; does the job, but is not a valid solution of course.

@Knuddelesel
Copy link

Das selbe Probleme besteht mit Joomla, da dort Query schon im "no conflict mode" arbeitet, hat es geholfen, alle $ mit jQuery zu ersetzen.

@criz:
I have the same problems with joomla, I haved to replaced all $ with jQuery.

@MRuy
Copy link

MRuy commented Dec 1, 2014

Modify the shariff.min.js like this:

(function ($) {
// code from shariff.min.js
})(jQuery);

Das gleiche problem wird es auch mit WordPress geben!

@pmb0
Copy link
Member

pmb0 commented Dec 1, 2014

Should be fixed now: 96a75e0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants