oleg-puzanov.com.ua

28 May, 2008

Announcing AJAX Libraries API: Speed up your Ajax apps with Google’s infrastructure

Posted by: Oleg Puzanov In: Programming

Google announced the Google AJAX Libraries API which exists to make Ajax applications that use popular frameworks such as Prototype, Script.aculo.us, jQuery, Dojo, and MooTools faster and easier for developers.

That’ s means that you could obtain any library version directly from Google server. You don’t need to store a lot of files on your server anymore. All libraries available in both standart and compressed versions.

You can access the libraries in two ways, and either way we take the pain out of hosting the libraries, correctly setting cache headers, staying up to date with the most recent bug fixes, etc.

The first way to access the scripts is simply be using a standard <script src=”..”> tag that points to the correct place.

For example, to load Prototype version 1.6.0.2 you would place the following in your HTML:

<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js"></script>

The second way to access the scripts is via the Google AJAX API Loader’s google.load() method.Here is an example using that technique to load and use jQuery for a simple search mashup:

<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>

Google  AJAX Libraries API page

Documentation

Via Ajaxian

Share and Enjoy:
  1. Digg
  2. Sphinn
  3. del.icio.us
  4. Facebook
  5. Mixx
  6. Google
  7. Ma.gnolia
  8. StumbleUpon
  9. Technorati

Like this entry? Share your love, vote for it

Top Blogs

No Responses to "Announcing AJAX Libraries API: Speed up your Ajax apps with Google’s infrastructure"

Comment Form

Categories

Subscribe

Subscribe to this blog via Feedburner (RSS)

Mobile version

Read this site from your iPhone, PDA or mobile phone. Mobile site version will be loaded automatically depends on your device.

BlogCatalog

Personal Blogs - BlogCatalog Blog Directory

BlogTopList