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:
<?php
drupal_add_js('footer.js');
?>
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:
<?php
drupal_add_js('footer.js', array('type' => 'file', 'scope' => 'footer'));
?>
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?