I using code here
<head>
...
<?php
$user =& JFactory::getUser();
if ($user->get('guest') == 1) {
$headerstuff = $this->getHeadData();
$headerstuff['scripts'] = array(); $this->setHeadData($headerstuff);
}
?>
<jdoc:include type="head" />
</head>
But when run code is template load all javascript, how to fix it remove all javasccript in header in template joomla
To remove a script you can use in your template:
$doc = JFactory::getDocument();
unset($doc->_scripts[$this->baseurl.'/media/system/js/mootools-core.js']);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With