开发者

Using Joomla's baseurl to import javascript

开发者 https://www.devze.com 2023-01-17 11:58 出处:网络
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\">

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!


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消