views:

22

answers:

1

Hi,

I am trying to use Joomla's basurl to link to my javascript files like this:

<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/js/music.js"></script>

My code highlighting though seems out of whack and I am wondering if anyone knows how I should be writing this please?

if I use it in the css link everything looks fine there:

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/music/css/nav.css" type="text/css" />

Many thanks!

+1  A: 

From looking at your include css and include js code it seems like your template is called music.

Therefore, you need to have your template's name as part of the path. Instead of /templates/js/ use /templates/music/js/

<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/music/js/music.js"></script>
Alex
Thanks Alex, I will give this a bash!
Sixfoot Studio
Instead of hard coding the template name you should use <?php echo $this->template; ?>
Brent Friar