後,我加入的JavaScript上templete的index.php如何可以包括組件JS templete的js
$doc = JFactory::getDocument();
$doc->addScript($this->baseurl . '/templates/' . $this->template . '/js/jquery.js', 'text/javascript');
和成分的添加另一對組件的下方
$document = JFactory::getDocument();
$document->addScript($this->baseurl . '/templates/' . $this->template . '/js/validation.js');
但總是JS(validation.js)獲得添加之前tempelete js(jquery.js)
如何添加組件js(validation.js)在模仿js(jquery.js)之後。
尼斯..你也可以使用這種方法,如果腳本文件只有有限的行你可以使用addScriptDeclaration也檢查這個http://docs.joomla.org/Adding_JavaScript –