I am getting "TypeError: $ is undefined" in Firebug when I call the drupal_add_js on an external jQuery file. If it were some local code, I would just wrap the code in a behavior function, like so:
(function($) {
Drupal.behaviors.addStuff = {
attach: function(context, settings) {
// jQuery code goes here.
}
}
};
I know that I'm supposed to change the dollar signs to "jQuery." but I can't do that to an external file (since I can't edit the code). How do I safely include this file? Note that this is just one module, I do not want to add it to my template file, and I do not want it to run on every page on my site.
window.$ = window.jQuery
. Of course that won't take into account any conflicts that arise, but that's just a standard JS, not something Drupal can help you solve