I\'m writing my own Drupal 7 module, and like to use JQuery in it.
$(\'#field\').toggle();
But I\'m getting this error:
TypeErr
According to Firebug, your jQuery file is being loaded:
But the $
is being overwritten by something else:
What you should do is encapsulate the use of the $
variable with a function that invokes itself using the jQuery
object as it's first actual argument:
(function ($) {
// in this function, you can use the $ which refers to the jQuery object
}(jQuery));