drupal_add_js cannot find my javascript file I am trying to add a simple footer.js to my page.  I created a new block and put it in the footer.  I then use PHP snippet in the body of the block with the PHP code:

&lt;?php
drupal_add_js('footer.js');
?&gt;


When viewing the source code, footer.js is there but when I click on it, it is a 404 error (not found).  The footer.js is located under: /var/www/drupal/sites/www.example.com/footer.js. Then I tried:

&lt;?php
drupal_add_js('footer.js', array('type' =&gt; 'file', 'scope' =&gt; 'footer'));
?&gt; 


I don't think that is working, either.  I think the issue is with the path.  Any ideas, or do I have to write a custom module?
It is most likely a path issue, you should be able to use the DRUPAL_ROOT constant to get the correct one:

$path = DRUPAL_ROOT . '/sites/www.example.com/footer.js';
drupal_add_js($path);