I wanted to add some javascript to a page from another website, so I put in:
drupal_add_js("http://www.somesite.com/stuff/mycode.js", 'module')
but the function added $base_url to the front, which broke the url.
I made a simple change to drupal_get_js in common.inc that seems to solve the problem:
switch ($type) {
case 'setting':
$output .= '
Drupal.extend({ settings: '. drupal_to_js(call_user_func_array('array_merge_recursive', $data)) ." });
\n";
break;
case 'inline':
foreach ($data as $info) {
$output .= '
'. $info['code'] ."
\n";
}
break;
//mitch - need something that doesn't make a relative path!
case 'remote':
foreach ($data as $path => $info) {
$output .= '
\n";
}
break;
//mitch
default:
foreach ($data as $path => $info) {
$output .= '
\n";
}