JoomlaWorks

Member Dashboard
  • Home
  • Extensions
    • Commercial
      • Frontpage Slideshow
      • K2 Plugin for sh404SEF
      • Simple Image Gallery Pro
      • SocialConnect
    • Free
      • K2
      • AllVideos
      • DISQUS Comments for Joomla!
      • IAKI (Import As K2 Image)
      • Simple Image Gallery
      • Simple RSS Feed Reader
    • Free On Github
      • Akismet for Kunena
      • Fill It Up
      • K2 Example Plugin
      • K2 Links for JCE
      • Rebuild K2 Image Cache (CLI utility for K2)
      • TinyLetter Subscribe
      • URL Normalizer
      • User Extended Fields for K2
  • Templates
    • Commercial Templates
      • Anagram
      • Archetype
      • BusinessOne
      • Ibento
      • Janaro
      • Kiji
      • Matchbox
      • nuMuzik
      • RadioWave
      • Toreda
    • Free Templates
      • nuModusVersus
      • Takai
  • Demos
    • Joomla Extension Demos
    • Joomla Template Demos
    • WordPress Plugin Demos
  • Labs
    • Web Apps
      • JoomlaReader
      • JSON 2 JSONP
      • Web Platform Tools
    • JavaScript Projects
      • Coming Soon...
  • Support
    • Documentation for Joomla Extensions
      • AllVideos
      • Frontpage Slideshow
      • Simple Image Gallery
      • Simple Image Gallery Pro
      • SocialConnect
    • Documentation for Joomla Templates
      • General Resources
        • Installation
        • Content
        • Customization
      • Commercial Templates
      • Free Templates
    • Get Help
      • Community Forum
        • Recent Topics
        • Categories
        • Create free account
      • Help Desk
      • Contact us by e-mail
      • Contact us on Facebook Messenger
      • Contact us on Twitter
  • About
    • Blog
    • Company
    • License & Terms of Service
    • Privacy Policy
  • My Account
01 03 2010
Written by  Fotis
Published in Blog
Tagged under
  • +Google AJAX Libraries API
  • +joomla
  • +mootools
11 comments

Replace Mootools in Joomla with a compressed copy from Google AJAX Libraries API

Replace Mootools in Joomla with a compressed copy from Google AJAX Libraries API

Google AJAX Libraries API

Here's an easy trick to replace the built-in Mootools library that comes in Joomla 1.5 with a compressed copy from Google AJAX Libraries API:

<!-- The following code goes into your template's index.php <head> tags, right before the <jdoc:include type="head" /> code block --><?php// Replace Mootools in Joomla with a compressed copy from Google AJAX Libraries API$document =&JFactory::getDocument();unset($document->_scripts[$this->baseurl . '/media/system/js/mootools.js']);?><script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("mootools", "1.1.2");</script>

There are 2 speed benefits by following this approach:

  1. We load a compressed copy of Mootools, so from around 73kb it drops to 18kb!
  2. We load Mootools from Google, thus our browser can simultaneously (in parallel) download Mootools along with the rest of our site's content.

It's a simple & easy trick we use on all our web projects, big or small. ;)

Read 102770 times
Tweet

11 comments

  • robertwent robertwent 22 Sep 2011
    Comment Link


    This works fine on gantry templates, just add it above the gantry head line.
    Any idea how to do this with 1.7? I can't actually see mootools loading in my sourcecode...

  • StormIT StormIT 07 Jul 2010
    Comment Link


    Great work replacing Mootools with Google AJAX Libraries API!

  • Sam M Sam M 10 Apr 2010
    Comment Link


    Cool extension takes it one step further (moo, jquery, swf)
    http://extensions.joomla.org/extensions/site-management/site-performance/6981" rel="nofollow">http://extensions.joomla.org/extensions/site-management/site-performance/6981

  • xspline xspline 10 Apr 2010
    Comment Link


    Yes, it's the very useful trick! Thanks!

  • Fotis Evangelou Fotis Evangelou 25 Mar 2010
    Comment Link


    It's best to ask RocketTheme for that :)


  • Sam M Sam M 25 Mar 2010
    Comment Link


    $gantry->displayHead();

  • Sam M Sam M 25 Mar 2010
    Comment Link


    How does this work with RT's Crystalline template and

  • massimo_romano massimo_romano 20 Mar 2010
    Comment Link


    Great work.

  • kachete kachete 11 Mar 2010
    Comment Link


    Very well done, great adition to any joomla site. best regards master Evangelou. Thanks

  • Fotis Evangelou Fotis Evangelou 03 Mar 2010
    Comment Link


    The ampersand is OK, it just got converted to HTML entity on paste... I've corrected this on the code block above.

  • brianteeman brianteeman 03 Mar 2010
    Comment Link


    You have a small error with the code with an extra & it should be just $document =JFactory::getDocument();
    I think??

Leave a comment

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

back to top
BY MAIL BY RSS

Archives

  • February 2021 (1)
  • December 2020 (1)
  • September 2020 (1)
  • June 2020 (1)
  • May 2020 (1)
  • February 2020 (1)
  • January 2020 (5)
  • December 2019 (2)
  • September 2019 (1)
  • July 2019 (3)
  • April 2019 (3)
  • February 2019 (4)

Tag Cloud

allvideos announcement apache community development frontpage slideshow joomla k2 Performance plugin release sh404sef simple image gallery simple image gallery pro simple rss feed reader socialconnect ssh tips update video

Latest Entries

  • Simple RSS Feed Reader v3.8.0 released
    Written by  Fotis
    03 Feb 2021
  • Improve the performance of your Joomla articles (part 1)
    Written by  Fotis
    04 Dec 2020
  • K2 Plugin for sh404SEF version 1.6.0 released
    Written by  Fotis
    14 Sep 2020
  • Simple Image Gallery Pro v3.8.0 released
    Written by  Fotis
    10 Jun 2020
  • AllVideos 6.1.0 now available - adds Mixcloud support
    Written by  Fotis
    22 May 2020

Join Our Newsletter

Enter your e-mail address to subscribe to our new or updated product notifications. We send combined newsletters, so we won't spam you every week :)

Get Social

  • Twitter
  • GitHub
  • Facebook
  • GitHub (K2)
  • YouTube
  • Speaker Deck

Grab Our Feeds

  • Extension Updates
  • Blog
  • Videos
  • Presentations
Copyright © 2006 - 2021 JoomlaWorks Ltd.
JoomlaWorks Ltd. and this site is not affiliated with or endorsed by The Joomla! Project™. Any products and services provided through this site are not supported or warrantied by The Joomla! Project or Open Source Matters, Inc. Use of the Joomla!® name, symbol, logo and related trademarks is permitted under a limited license granted by Open Source Matters, Inc.
designed by Nuevvo