Alloy UI

io  1.0.1

 
Filters

Class io

The io class is a utility that brokers HTTP requests through a simplified interface. Specifically, it allows JavaScript to make HTTP requests to a resource without a page reload. The underlying transport for making same-domain requests is the XMLHttpRequest object. YUI.io can also use Flash, if specified as a transport, for cross-domain requests.

Methods

header

static header ( l , v )
Method that stores default client headers for all transactions. If a label is passed with no value argument, the header will be deleted. This is the interface for _setHeader().
Parameters:
l <string> - HTTP header
v <string> - HTTP header value
Returns:
int

io

static io ( uri , c )
Method for requesting a transaction. This is the interface for _io().
Parameters:
uri <string> - qualified path to transaction resource.
c <object> - configuration object for the transaction.
Returns:
object

promote

static promote ( o )
Method for promoting a transaction to the top of the queue. This is the interface for _unshift().
Parameters:
o <Object> - Reference to queued transaction.
Returns:
void

remove

static remove ( o )
Method for removing a specific, pending transaction from the queue. This is the interface for _remove().
Parameters:
o <Object> - Reference to queued transaction.
Returns:
void

size

static size ( i )
Method to query the current size of the queue, or to set a maximum queue size. This is the interface for _size().
Parameters:
i <number> - Specified maximum size of queue.
Returns:
number

start

static start ( )
Method for setting the queue to active. If there are transactions pending in the queue, they will be processed from the queue in FIFO order. This is the interface for _start().
Returns:
void

stop

static stop ( )
Method for setting queue processing to inactive. Transaction requests to YUI.io.queue() will be stored in the queue, but not processed until the queue is restarted. This is the interface for _stop().
Returns:
void

transport

static transport ( o )
Method to initialize the desired transport.
Parameters:
o <object> - object of transport configurations.
Returns:
void

Events

io:complete

io:complete ( )
This event is fired by YUI.io when a transaction is complete. Response status and data are accessible, if available.

io:end

io:end ( )
This event signifies the end of the transaction lifecycle. The transaction transport is destroyed.

io:failure

io:failure ( )
This event is fired by YUI.io when a transaction is complete, and the HTTP status resolves to HTTP4xx, 5xx and above.

io:start

io:start ( )
This event is fired by YUI.io when a transaction is initiated.

io:success

io:success ( )
This event is fired by YUI.io when a transaction is complete, and the HTTP status resolves to HTTP2xx.

io:xdrReady

io:xdrReady ( )
This event is fired by YUI.io when the specified transport is ready for use.