4.1. The Yahoo! Connection Manager

In late 2005, Yahoo! introduced its Yahoo! User Interface (YUI) library to the open source community. Available under a BSD-style license at http://developer.yahoo.com/yui, the YUI comprises several JavaScript libraries used within the company to aid in the rapid development of web applications such as Yahoo! Mail and Yahoo! Photos. One of these libraries is the Yahoo! Connection Manager.

With Ajax making heavy use of XHR, many developers are looking for ways to equalize the differences between browser implementations. The Yahoo! Connection Manager does this by handling all of the processing behind the scenes, exposing a simple API that frees developers from cross-browser concerns.

4.1.1. Setup

Before beginning, download the YUI library at http://sourceforge.net/projects/yui. A single ZIP file contains all of the JavaScript files necessary to use the Connection Manager. For basic Connection Manager usage, you need two required JavaScript files: YAHOO.js, which sets up the YAHOO namespace (this file is used by all Yahoo! JavaScript components), and connection.js, which contains the Connection Manager code. The files must be included in this order:

<script type="text/javascript" src="/js/YAHOO.js"></script>
<script type="text/javascript" src="/js/connection.js"></script>

With these files included in your page, you are now ready to begin using the Connection Manager.

4.1.2. Basic Requests

The Yahoo! Connection Manager uses a different interface ...

Get Professional Ajax, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.