The AJAX Library API is a content distribution network that loads the architecture of the most popular open source JavaScript libraries. By using the Google AJAX API loader's google.load() method, your application can quickly access a growing list of the most popular open source JavaScript libraries from anywhere in the world, including:
jQuery
jQuery UI
Prototype
script.aculo.us
MooTools
Dojo
SWFObject
Yahoo! User Interface Libraries (YUI) Google works directly with key stakeholders to safeguard the interests of each library and accepts the latest stable versions as they are released. Once we host a version of a given library, we commit to hosting that version indefinitely.
The AJAX library API eliminates the inconvenience of developing mashups in JavaScript while using a collection of libraries. We eliminate the inconvenience of hosting libraries, set cache headers correctly, stay current with the latest bugfix dates, and more.
<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.responseData.results &&
data.responseData.results.length > 0) {
var results = data.responseData.results;
for (var i=0; i < results.length; i++) {
// Display each result however you wish
alert(results[i].titleNoFormatting);
}
}
});
});
</script>
This article comes from the CSDN blog. Please indicate the source when reprinting: http://blog.csdn.net/wjlwjlwjlwjl/archive/2009/12/18/5029582.aspx
-