I have been asked to include an external js file into a site where I don't have direct access to modify it and the generated script has jQuery it that references $.
Is it possible to include this without modifying the source js file?
I've added it as below
drupal_add_js("www.domain.com/my.js", array(
'type' => 'external',
'scope' => 'header',
'group' => JS_LIBRARY,
'every_page' => TRUE,
'weight' => -1,
));
But I get undefined errors due to the use of $
Cheers
$ = jQuery
somewhere before that script loads; but bear in mind you'll break jQuery no conflict, whether that causes problems depends on what other JS your site needs. This is really more of a JS question rather than a Drupal one