I would like to add a custom JS in the header, but this JS is related to a specific component developed for the site. So, the template related way to insert in the head block
- Code: Select all
$this->API->addJS($this->API->URLtemplate() . '/js/my_script.js');
can't work as it's not in the template folder (and I can't move it). The usual Joomla way
- Code: Select all
<script src="<?php echo $this->baseurl; ?>/components/com_mycomponent/assets/js/my_script.js" ></script>
doesn't work either because it's generating a parse error. How can I call this script in the template ?
Thanks.
