Google AJAX API Library: a turning point for developers

Thursday, May 29, 2008

AJAX API Libraries Google, in the latter perdiodo, has released a multitude of tools dedicated to developers, continuously updating their releases. Now running out an agreement with popular AJAX framework, and not only to centralize the distribution of libraries jQuery, prototype, script.aculo.us, MooTools and dojo!

In practice, you can access these libraries using the infrastructure and the Google network, with significant benefits in terms of speed and security.

The speed, loading, is guaranteed by the same network that Google and provide per se a distributed server, allowing (by default) loading compressed (gzip / minify) library. The hosting Google closer to the request will be used to send the code and, if not reaching down or temporarily, the Google network will still send the Javascript code!

Using Google AJAX API Library

We can choose two ways to load a library: exploiting google.load() the usual <script> For example, if we have an application that already uses some other Google API (maps, research, translations, etc ...) can exploit the instance of google

HTML:
  1. <! - First of all you load the environment ->
  2. > </script> <script src = "http://www.google.com/jsapi"> </ script>

Now we have an object google available:

JavaScript:
  1. "prototype" , "1.6" ) ; google. load ( "prototype", "1.6");

Note the presence of the version! Google AJAX API Library is also a repository of past - stable - release. But that's not all! The versioning is intelligent. If a library is available in the following release:

CODE:
  1. . 1 1. 9. 1
  2. . 4 1. 8. 4
  3. . 2 1. 8. 2

Specifying, for example:

JavaScript:
  1. "prototype" , "1.8" ) ; google. load ( "prototype", "1.8");

Will release 1.8.4, which is the last of that revision. Similarly specifying:

JavaScript:
  1. "prototype" , "1" ) ; google. load ( "prototype", "1");

Will release 1.9.1! Fantastico!
Or you can use the following syntax:

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

Again you can specify the version!

Google itself, however, stresses that the first method, which uses google.load() is the most performed!

Try to believe: and the results are

As always, I felt immediately this news and I have appreciated the benefits immediately. I introduced the Google AJAX API Library on Divoogle.com and e-lementi.com! On this I had a gain in load equal to 30% - tests carried out with PingDom! I also tried the two different methods of loading and, indeed, the use of google.load() much better!
As soon as possible I'll run the test again on undolog.com : P

Related Post

4 comments to: "Google AJAX API Library: a turning point for developers"

  1. Sunday 01 June, 2008 at 16:16
    @ Tom IWriteAboutIT said:

    Congratulations to the article, I just I just added to my RSS,
    Quick Tom

    Answer Quote
  2. Wednesday 02 July, 2008 at 11:51 a.m.
    Levysoft "How to save bandwidth: reducing email comments and backup via FTP, use the AJAX Library API with plugin for Wordpress and disable Google Translator that does not lead to useful traffic Adsense said:

    [...] And allows you to specify that you want. The versioning is, however, even intelligent. In fact, if you specify a partial version of the library (p.es 1.8), we will download Google [...]

  3. Friday 03 October, 2008 at 14:00
    Wordpress: how to write a reply to comment using jQuery | Undolog.com said:

    [...] The two scripts include jQuery through the Google service explained in Google AJAX API Library: a turning point for developers [...]

  4. Thursday, 09 October, 2008 at 11:46 a.m.
    Francesco Gavello said:

    I find that blogs increasingly useful :)
    This technique did not know then and it is really a manna from heaven!

    To read!

    Answer Quote

Leave a comment

TAG XHTML <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <a <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Use <pre> to enclose code