首页 > 未分类 > google apis

google apis

Developer’s Guide

The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries. By using the google.load() method, your application has high speed, globally available access to a growing list of the most popular, open source JavaScript libraries.

Table of Contents

Audience

This documentation is designed for people familiar with JavaScript programming and object-oriented programming concepts. There are many JavaScript tutorials available on the Web.

Introduction

The AJAX Libraries API provides your applications with stable, reliable, high speed, globally available access to all of the most popular, open source JavaScript libraries. Your application can use our very flexible loader google.load() or direct, path based access to the scripts.

Using google.load()

The most powerful way to load the libraries is by using google.load() to name a library and your prefered version. E.g.:

  google.load("jquery", "1.3.2");
  google.load("jqueryui", "1.7.2");
  google.load("prototype", "1.6.1.0");
  google.load("scriptaculous", "1.8.3");
  google.load("mootools", "1.2.4");
  google.load("dojo", "1.4.0");
  google.load("swfobject", "2.2");
  google.load("yui", "2.8.0r4");
  google.load("ext-core", "3.0.0");

As you can see in the code snippets above, the first argument to google.load is the name of a library. The second argument is a version specification. The complete list of Ajax libraries is a growing collection of the most popular, open source JavaScript libraries.

Versioning with google.load()

The versioning system allows your application to specify a desired version with as much precision as it needs. By dropping version fields, you end up wild carding a field. For instance, consider a set of versions:

1.9.1
1.8.4
1.8.2

Specifying a version of "1.8.2" will select the obvious version. This is because a fully specified version was used. Specifying a version of "1.8" would select version 1.8.4 since this is the highest versioned release in the 1.8 branch. For much the same reason, a request for "1" will end up loading version 1.9.1. Note, these versioning semantics work the same way when using google.load and when using direct script urls.

Ajax Libraries

Each library is available via both google.load() and directly, via <script/> tag. The google.load() approach offers the most functionality and performance. In the sections that follow, we document all of the libraries that are available. For each library we list its name (as in the name used in google.load()), all of the versions that we have on hand for the library, etc.

jQuery
name: jquery
versions: 1.2.3, 1.2.6, 1.3.0, 1.3.1, 1.3.2
load request: google.load("jquery", "1.3.2");
extras: uncompressed:true, e.g., google.load("jquery", "1.3.2", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
path(u): http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
site: http://jquery.com/
note: 1.2.5 and 1.2.4 are not hosted due to their short and unstable lives in the wild…

jQuery UI
name: jqueryui
versions: 1.5.2, 1.5.3, 1.6, 1.7.0, 1.7.1, 1.7.2
load request: google.load("jqueryui", "1.7.2");
extras: uncompressed:true, e.g., google.load("jqueryui", "1.7.2", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js
path(u): http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js
site: http://ui.jquery.com/
note: This library depends on jquery. Before loading this module, you must load jquery. e.g.:

  google.load("jquery", "1.3.2");
  google.load("jqueryui", "1.7.2");

Prototype
name: prototype
versions: 1.6.0.2, 1.6.0.3, 1.6.1.0
load request: google.load("prototype", "1.6.1.0");
path: http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js
site: http://www.prototypejs.org/

script.aculo.us
name: scriptaculous
versions: 1.8.1, 1.8.2, 1.8.3
load request: google.load("scriptaculous", "1.8.3");
path: http://ajax.googleapis.com/ajax/libs/scriptaculous/1.8.3/scriptaculous.js
site: http://script.aculo.us/
note: This library depends on Prototype. Before loading this module, you must load Prototype. e.g.:

  google.load("prototype", "1.6");
  google.load("scriptaculous", "1.8.3");

MooTools
name: mootools
versions: 1.1.1, 1.1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4
load request: google.load("mootools", "1.2.4");
extras: uncompressed:true, e.g., google.load("mootools", "1.2.4", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools-yui-compressed.js
path(u): http://ajax.googleapis.com/ajax/libs/mootools/1.2.4/mootools.js
site: http://mootools.net/
note: Since 1.1 versions are not compatible with 1.2 versions, specifying version “1” will map to the latest 1.1 version (currently 1.1.2).

Dojo
name: dojo
versions: 1.1.1, 1.2.0, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.4.0
load request: google.load("dojo", "1.4.0");
extras: uncompressed:true, e.g., google.load("dojo", "1.4.0", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js
path(u): http://ajax.googleapis.com/ajax/libs/dojo/1.4.0/dojo/dojo.xd.js.uncompressed.js
site: http://dojotoolkit.org/

SWFObject
name: swfobject
versions: 2.1, 2.2
load request: google.load("swfobject", "2.2");
extras: uncompressed:true, e.g., google.load("swfobject", "2.2", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js
path(u): http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject_src.js
site: http://code.google.com/p/swfobject/

Yahoo! User Interface Library (YUI)
name: yui
versions: 2.6.0, 2.7.0, 2.8.0r4
load request: google.load("yui", "2.8.0r4");
extras: uncompressed:true, e.g., google.load("yui", "2.8.0r4", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/yui/2.8.0r4/build/yuiloader/yuiloader-min.js
path(u): http://ajax.googleapis.com/ajax/libs/yui/2.8.0r4/build/yuiloader/yuiloader.js
site: http://developer.yahoo.com/yui/

Ext Core
name: ext-core
versions: 3.0.0
load request: google.load("ext-core", "3.0.0");
extras: uncompressed:true, e.g., google.load("ext-core", "3.0.0", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/ext-core/3.0.0/ext-core.js
path(u): http://ajax.googleapis.com/ajax/libs/ext-core/3.0.0/ext-core-debug.js
site: http://extjs.com/products/extcore/

Chrome FrameNew!
name: chrome-frame
versions: 1.0.0, 1.0.1, 1.0.2
load request: google.load("chrome-frame", "1.0.2");
extras: uncompreassed:true, e.g., google.load("chrome-frame", "1.0.2", {uncompressed:true});
path: http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js
path(u): http://ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.js
site: http://code.google.com/chrome/chromeframe/
Advertisements
分类:未分类
  1. 还没有评论。
  1. No trackbacks yet.

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: