Call

Tag Archives: MooTools

Making web pages load faster by using Google’s AJAX Libraries

0
Filed under Web Developement

If you use a JavaScript framework like Mootools or jQuery, you may want to consider using Google’s AJAX Libraries. By utilising Google’s servers and distributing scripts across multiple hosts your webpage should load much quicker.

Firstly you will need to sign up for a Google API key for your website: http://code.google.com/apis/ajaxsearch/signup.html

Once registered, put the following in the header section of your web pages replacing the key parameter with you registered key.

<script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"></script>

To use Google’s libraries use the google.load() function:
For jquery:

<script type="text/javascript">	
   google.load("jquery", "1.3.2");
</script>

For MooTools (replace 1.2.4 with the version that is required):

<script type="text/javascript">	
   google.load("mootools", "1.2.4");
</script>

Alternatively, you can also have an external link to the library:

For jquery:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

For MooTools:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

For a complete list of option, please see the Developer’s Guide http://code.google.com/apis/ajaxlibs/documentation/index.html#googleDotLoad