How to remove mootools.js and caption.js from Joomla1.5
Written by Li   

For most Joomla 1.5 template, they don't use mootools.js and caption.js at all. These two javasript libiaries are mainly used in the adiminstrator control panal. Their size are about 75K, and decrease the response speed of Joomla site. Here I introduce a method to remove the two javascript libs.

To make sure your Joomla site have the two scripts in the front site, you can look you site's html source code and will find the following code:

  <script type="text/javascript" src="/media/system/js/mootools.js"></script>
  <script type="text/javascript" src="/media/system/js/caption.js"></script>

To remove the above javascript's import, you just need to add the following code at the top of your template's index.php file.

		<?php 
		//remove mootools.js and caption.js
		$headerstuff=$this->getHeadData();
		reset($headerstuff['scripts']);
		foreach($headerstuff['scripts'] as $key=>$value){
		  unset($headerstuff['scripts'][$key]);
		}		
		$this->setHeadData($headerstuff);
		?>
   

Clear cache and go back to you front site's source code, you will find the mootools.js and caption.js gone.




 
Recommend Read