Smart Polling

io  1.0.0

Smart Polling > io > io
Search:
 
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

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.

promote

static promote ( i )
Method for promoting a transaction to the top of the queue. This is the interface for _unshift().
Parameters:
i <number> - ID of queued transaction.

purge

static purge ( i )
Method for removing a specific, pending transaction from the queue. This is the interface for _purge().
Parameters:
i <number> - ID of queued transaction.

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.

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().

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 set to "active". This is the interface for _stop().

transport

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

Events

io:abort

io:abort ( )
This event is fired by YUI.io when a transaction is aborted explicitly or by a defined config.timeout.

io:complete

io:complete ( )
This event is fired by YUI.io when a transaction is complete and all response data are available.

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.


Copyright © 2009 Yahoo! Inc. All rights reserved.