我在 Joomla 中创建了一个模板!3x,但我想删除页眉中的默认 JavaScript 代码和样式表。
我的代码是:
$doc = JFactory::getDocument();
//Remove default configuration
$doc->setGenerator("");
$headData = $doc -> getHeadData();
unset($headData['metaTags']['http-equiv']);
$doc -> setHeadData($headData); //Is OK
$doc -> _styleSheets = array(); //Is OK
$doc -> _scripts = array(); //Is OK
$doc -> _script = array(); **// Not OK**
//Add foundation
$doc->addStyleSheet('templates/'.$this->template.'/css/foundation.css');
$doc->addScript('templates/'.$this->template.'/js/jquery.js');
$doc->addScript('templates/'.$this->template.'/js/modernizr.foundation.js');
模板标题 HTML 现在是:
function keepAlive() { var myAjax = new Request({method: "get", url: "index.php"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(840000); });
jQuery(document).ready(function() {
jQuery('.hasTooltip').tooltip({});
});
// The block is not removed
如何删除此 JavaScript 代码?
参考文件:
- /libraries/joomla/html/behavior.php
- /libraries/cms/html/bootstrap.php