Yahoo! UI Library

connection  2.3.0

Yahoo! UI Library > connection > YAHOO.util.Connect

Show Private Show Protected

Class YAHOO.util.Connect

The Connection Manager singleton provides methods for creating and managing asynchronous transactions.

Properties

Methods

abort

static boolean abort ( o , callback , isTimeout )
Method to terminate a transaction, if it has not reached readyState 4.
Parameters:
o <object> The connection object returned by asyncRequest.
callback <object> User-defined callback object.
isTimeout <string> boolean to indicate if abort resulted from a callback timeout.
Returns: boolean

asyncRequest

static object asyncRequest ( method , uri , callback , postData )
Method for initiating an asynchronous request via the XHR object.
Parameters:
method <string> HTTP transaction method
uri <string> Fully qualified path of resource
callback <callback> User-defined callback function or object
postData <string> POST body
Returns: object
Returns the connection object

initHeader

static void initHeader ( label , value , isDefault )
Method that initializes the custom HTTP headers for the each transaction.
Parameters:
label <string> The HTTP header label
value <string> The HTTP header value
isDefault <string> Determines if the specific header is a default header automatically sent with each transaction.
Returns: void

isCallInProgress

static boolean isCallInProgress ( o )
Public method to check if the transaction is still being processed.
Parameters:
o <object> The connection object returned by asyncRequest
Returns: boolean

resetDefaultHeaders

static void resetDefaultHeaders ( )
Resets the default HTTP headers object
Returns: void

setDefaultPostHeader

static void setDefaultPostHeader ( b )
Member to enable or disable the default POST header.
Parameters:
b <boolean> Set and use default header - true or false .
Returns: void
void

setDefaultXhrHeader

static void setDefaultXhrHeader ( b )
Member to enable or disable the default POST header.
Parameters:
b <boolean> Set and use default header - true or false .
Returns: void
void

setForm

static string setForm ( form , optional )
This method assembles the form label and value pairs and constructs an encoded string. asyncRequest() will automatically initialize the transaction with a a HTTP header Content-Type of application/x-www-form-urlencoded.
Parameters:
form <string || object> id or name attribute, or form object.
optional <boolean> enable file upload.
optional <boolean> enable file upload over SSL in IE only.
Returns: string
string of the HTML form field name and value pairs..

setPollingInterval

static void setPollingInterval ( i )
Member to modify the default polling interval.
Parameters:
i <int> The polling interval in milliseconds.
Returns: void
void

setProgId

static void setProgId ( id )
Member to add an ActiveX id to the existing xml_progid array. In the event(unlikely) a new ActiveX id is introduced, it can be added without internal code modifications.
Parameters:
id <string> The ActiveX id to be added to initialize the XHR object.
Returns: void
void


Copyright © 2007 Yahoo! Inc. All rights reserved.