Remove Mootools From Joomla 1.5 Website


Sometimes(most times) you don’t need mootools to load, cause well, you don’t need it. Mootools is a javascript library that loads by default on joomla websites but there are times when you don’t want it to load like for example i develop mobile sites, so i dont need mootools to load because it makes loading the sites on a mobile device extremely slow. I think its about 90kb.  And thats well over the “recommend” 20kb limit.

So how do i remove mootools from the header?

Put this code at the top of your template.

    $user =& JFactory::getUser();
    //Get the current head data
    $headerstuff = $this->getHeadData();
    //create new empty array for the scripts key, which store all the scripts
    $headerstuff['scripts'] = array();
    //replace into Head Data

That should do the trick.

About the author

Talifhani Luvhengo

A collection of particles named Tali Luvhengo

Add comment


Page optimized by WP Minify WordPress Plugin