Wrong path with drupal.add.js
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);