Wrong path with drupal.add.js The problem occurs when a node alias consists of a backslash. 

My example: 

drupal_add_js(path_to_theme() . '/js/script.js', array(
    'type' =&gt; 'external', 
    'scope' =&gt; 'footer', 
    'weight' =&gt; 5
));


Now I have a node with the alias EXAMPLE/example.html

The path to the script.js is now domain.com/EXAMPLE/sites/all/themes/example/js/script.js and not domain.com/sites/all/themes/example/js/script.js

What do I do to make the path right?
Try making it absolute:

$options = array(
  'type' =&gt; 'external', 
  'scope' =&gt; 'footer', 
  'weight' =&gt; 5,
  'absolute' =&gt; TRUE
);
drupal_add_js(path_to_theme() . '/js/script.js', $options);