Google Provides Hosting for Popular Ajax Libraries
Google has created the Ajax Libraries API. Basically Google is calling it a content distribution network and loading architecture for the most popular open source JS libraries. These libraries include:
- jQuery
- prototype
- script.aculo.us
- MooTools
- dojo
If you use the Google JS API, you can do stuff like:
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <script src="http://www.google.com/jsapi"></script> <script> // Load jQuery google.load("jquery", "1"); // on page load complete, fire off a jQuery json-p query // against Google web search google.setOnLoadCallback(function() { $.getJSON("http://ajax.googleapis.com"+ "/ajax/services/search/web?q=google&;v=1.0&;callback=?", // on search completion, process the results function (data) { if (data.responseDate.results && data.responseDate.results.length>0) { renderResults(data.responseDate.results); } }); }); </script> |
Notice the dynamic loading of the jQuery library. Not a fan of the Google JS API? No worries, Google publishes the direct URLs for all the various javascript library files including minimized and full versions.
Resources
AJAX Libraries API
http://code.google.com/apis/ajaxlibs/
Documentation
http://code.google.com/apis/ajaxlibs/documentation/index.html