HomeAJAX & Prototype Using the google.load() Method with Google`s Ajax Libraries API
Using the google.load() Method with Google`s Ajax Libraries API
Google's Ajax Libraries API is a programming interface that permits web developers to download popular JavaScript packages, such as Prototype, jQuery and Scriptaculous, directly from Google’s servers instead of using local copies of these libraries. In this fourth part of a four-part series on using the API, you'll learn how to serve the jQuery framework without compression.
Naturally, the major benefit in using this API is its capacity for delivering a specified JavaScript framework at a higher speed (source files are usually compressed by default). This can also improve the performance of a client-side application utilizing the interface.
However, it’s also fair to mention one possible down side of this approach. Each time a web application requests a particular JavaScript package by means of this API, Google tracks the event. Some web developers might find this undesirable.
Despite this potential issue, the Google API can be really useful for delivering JavaScript files very quickly, since it allows you to specify, via client-side scripting, whether a specific library must be downloaded compressed or uncompressed. This feature can be completely controlled via the “google.load()” method. Indeed, in the previous article, I explained how to serve the Prototype package from Google’s servers without using compression.
Nonetheless, as I said in the beginning, the Google API supports working with other JavaScript libraries, including jQuery, Dojo and MooTools. Therefore, in this final episode of the series, I’ll be demonstrating how to serve the jQuery framework via this API, this time without using HTTP compression.
Are you ready to tackle the final chapter of this educational journey? Then, start reading now!