[solved] How to disable unneeded scripts in joomla 3.6 (img.caption js.migrate...)

  • (3 votes)
  • Written by 
  • Saturday, 29 October 2016 14:45

joomla 3.6.4 default template c215a

To disable scripts you can insert here the php code in the head pattern

<?php
unset($this->_scripts[$this->baseurl.'/media/system/js/mootools-core.js'], 
	$this->_scripts[$this->baseurl.'/media/system/js/mootools-more.js'],
	$this->_scripts[$this->baseurl.'/media/system/js/core.js'],
	$this->_scripts[$this->baseurl.'/media/jui/js/bootstrap.min.js'],
	$this->_scripts[$this->baseurl.'/media/jui/js/jquery.min.js'],
	$this->_scripts[$this->baseurl.'/media/jui/js/jquery-noconflict.js'],
	$this->_scripts[$this->baseurl.'/media/jui/js/jquery-migrate.min.js'],
	$this->_scripts[$this->baseurl.'/media/system/js/caption.js']);

if( isset($this->_script['text/javascript']) ) {
        $this->_script['text/javascript'] = preg_replace('\.addEvent\(\'load\',\s*(\'img.caption\'\);\s*}\);\s*%', '', $this->_script['text/javascript']);
        if( empty($this->_script['text/javascript']) )
        unset( $this->_script['text/javascript'] );
};
?>
1368 Read Last modified on Saturday, 29 October 2016

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.