If I add the script in full it works fine. If I add the code to /js/user.js and then add the full URL link to the file - as if it was an external file - in the bottom of the index.php file, it also works, fine, e.g:
However, I'd rather not have the full link visible, but if I try to add it via a local reference (using both double and single quotes), it doesn't work, e.g.:
I have also tried adding a php instruction like this:
<?php $doc = JFactory::getDocument(); $doc->addScript('templates/'. $this->template . '/js/user.js'); ?>
Which works for the template.js at the top of the file, but it doesn't work in this position at the bottom, either.
What am I doing wrong? Thanks.