Using Google AJAX Libraries API


I bet, you already hear about Google AJAX Libraries. Google are hosting copies of jQuery, Prototype, mooTools and Dojo on their CDN.
You can load any available version using it’s API. But i see, that some people experiencing troubles using API and their own scripts.

Here is a quick solution.

google.load("jquery", "1");
google.setOnLoadCallback(function() {
  $('<script type="text/javascript" src="your_script.js"></script>').appendTo('head');
  $('<script type="text/javascript" src="another_your_script.js"></script>').appendTo('head');

You can also load jquery plugins in that way.

Managed WordPress Hosting

Did you like it? Help us spread the word!

Do you have something to say?