I'm almost getting crazy with this...

My Problem: I have a module with its own css and jquery-plugin. When i add it directly to the theme.info via scripts[] everything is fine. But when i try to integrate it with drupal_add_js() from out of the mymodule.module I get a Reference Error


how do i load the jquery plugin from my module in my relative path mymodule/js/javascript.js?

I already checked out what others wrote. The plugin starts with (function($).. and ends with })(jQuery)

What else can I do?

  • after using drupal_add_js have you checked the "page source"? is the js file loaded properly? – Vimalnath Sep 14 '12 at 11:42
  • @vimalnath thanks for asking... The source is loaded...as far as chrome tells me... – Jurudocs Sep 14 '12 at 11:45
  • stackoverflow.com/questions/1061397/jquery-noconflict-issue this might help you Actually this issue happens when there is a conflict in the DOM objects.http://api.jquery.com/jQuery.noConflict/ – Vimalnath Sep 14 '12 at 11:56
  • @vimalnath thank you for the link...what i don't understand is: why drupal has no problems, when i add it to the template info file... – Jurudocs Sep 14 '12 at 12:12
  • By default, drupal includes a jquery.js, check if you are over-writing it.Also check if your jquery plugin is compatible with drupal's jquery version – Vimalnath Sep 17 '12 at 7:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.