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. IO can also use Flash, if specified as a transport, for cross-domain requests.
IOconfig
Defined in
io/js/io-base.js:18
config
Object
Object of EventTarget's publish method configurations used to configure IO's events.
_aborto
c
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:92
Method for intiating an XDR transaction abort.
_aborttransaction
type
Defined in
io/js/io-base.js:516
Terminates a transaction due to an explicit abort or timeout.
_addDataf
s
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:50
Parses the POST data object and creates hidden form elements for each key-value, and appends them to the HTML form object.
o Array of created fields.
_cFrameo
c
io
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:15
Creates the iframe transported used in file upload transactions, and binds the response event handler.
_clearTimeoutid
Defined in
io/js/io-base.js:451
Clears the timeout interval started by _startTimeout().
id
Number
_clearUploadTimeoutid
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:165
Clears the timeout interval started by _startUploadTimeout().
id
Number
_concaturi
data
Defined in
io/js/io-base.js:386
Method that concatenates string data for HTTP GET transactions.
_createcfg
id
Defined in
io/js/io-base.js:94
Method that creates a unique transaction object for each request.
The transaction object
_datao
u
d
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:69
Creates a response object for XDR transactions, for success and failure cases.
_dFrameid
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:35
Removes the iframe transport used in the file upload transaction.
id
Number
The transaction ID used in the iframe's creation.
_evteventName
transaction
config
Defined in
io/js/io-base.js:170
Method for creating and firing events.
_ieEvto
c
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:127
Sets event handlers for XDomainRequest transactions.
_isInProgresso
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:104
Method for determining if an XDR transaction has completed and all data are received.
o
Object
_qShiftProvided by the io-queue module.
Defined in
io/js/io-queue.js:35
Method Process the first transaction from the queue in FIFO order.
_removeDataf
o
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:83
Removes the custom fields created to pass additional POST data, along with the HTML form fields.
_resetAttrsf
a
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:123
Reset the HTML form attributes to their original values.
_resulttransaction
config
Defined in
io/js/io-base.js:463
Method that determines if a transaction response qualifies as success or failure, based on the response HTTP status code, and fires the appropriate success or failure events.
_retrytransaction
uri
config
Defined in
io/js/io-base.js:370
Retry an XDR transaction, using the Flash tranport, if the native transport fails.
_rStransaction
config
Defined in
io/js/io-base.js:492
Event handler bound to onreadystatechange.
_serializec
s
Provided by the io-form module.
Defined in
io/js/io-form.js:36
Enumerate through an HTML form's elements collection and return a string comprised of key-value pairs.
_setAttrsf
id
uri
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:100
Sets the appropriate attributes and values to the HTML form, in preparation of a file upload transaction.
_setHeaderstransaction
headers
Defined in
io/js/io-base.js:416
Method that sets all HTTP headers to be sent in a transaction.
_sizeProvided by the io-queue module.
Defined in
io/js/io-queue.js:144
Method to query the current size of the queue.
_startTimeouttransaction
timeout
Defined in
io/js/io-base.js:434
Starts timeout count if the configuration object has a defined timeout property.
_startUploadTimeouto
c
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:142
Starts timeout count if the configuration object has a defined timeout property.
_stopProvided by the io-queue module.
Defined in
io/js/io-queue.js:130
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 reset to "active".
_swfuri
yid
uid
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:47
Method that creates the Flash transport swf.
_uploado
uri
c
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:223
Uploads HTML form data, inclusive of files/attachments, using the iframe created in _create to facilitate the transaction.
_uploadCompleteo
c
Provided by the io-upload-iframe module.
Defined in
io/js/io-upload-iframe.js:179
Bound to the iframe's Load event and processes the response data.
_xdrReadyyid
uid
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:252
Fires event "io:xdrReady"
completetransaction
config
Defined in
io/js/io-base.js:248
Fires event "io:complete" and creates, fires a transaction-specific "complete" event, if config.on.complete is defined.
emptyMethod for cancel all pending transaction from the queue.
endtransaction
config
Defined in
io/js/io-base.js:267
Fires event "io:end" and creates, fires a transaction-specific "end" event, if config.on.end is defined.
errortransaction
error
config
Defined in
io/js/io-base.js:355
Fires event "io:failure" and creates, fires a transaction-specific "failure" event -- for XMLHttpRequest file upload -- if config.on.failure is defined.
failuretransaction
config
Defined in
io/js/io-base.js:302
Fires event "io:failure" and creates, fires a transaction-specific "failure" event, if config.on.failure is defined.
flatteno
Provided by the io-nodejs module.
Defined in
io/js/io-nodejs.js:23
Flatten headers object
o
Object
The headers object
The flattened headers object
loadtransaction
load
config
Defined in
io/js/io-base.js:340
Fires event "io:complete" and creates, fires a transaction-specific "complete" event -- for XMLHttpRequest file upload -- if config.on.complete is defined.
progresstransaction
progress
config
Defined in
io/js/io-base.js:320
Fires event "io:progress" and creates, fires a transaction-specific "progress" event -- for XMLHttpRequest file upload -- if config.on.progress is defined.
promoteProvided by the io-queue module.
Defined in
io/js/io-queue.js:86
Method for promoting a transaction to the top of the queue.
queueProvided by the io-queue module.
Defined in
io/js/io-queue.js:52
Method for queueing a transaction before the request is sent to the resource, to ensure sequential processing.
removeProvided by the io-queue module.
Defined in
io/js/io-queue.js:96
Method for removing a specific, pending transaction from the queue.
requestProvided by the io-nodejs module.
Defined in
io/js/io-nodejs.js:7
Passthru to the NodeJS request module.
This method is return of require('request') so you can use it inside NodeJS without
the IO abstraction.
senduri
config
id
Defined in
io/js/io-base.js:531
Requests a transaction. send() is implemented as Y.io(). Each
transaction may include a configuration object. Its properties are:
true to also serialize disabled form field values
(defaults to false)timeout.success or failure.<p>Callback functions for start and end receive the id of the
transaction as a first argument. For complete, success, and
failure, callbacks receive the id and the response object
(usually the XMLHttpRequest instance). If the arguments
property was included in the configuration object passed to
Y.io(), the configured data will be passed to all callbacks as
the last argument.</p>
</dd>
true to make a same-domain transaction synchronous.
CAVEAT: This will negatively impact the user
experience. Have a very good reason if you intend to use
this.
this'" object for all configured event handlers. If a
specific context is needed for individual callbacks, bind the
callback to a context usingY.bind()`.
Y.io({ ..., "arguments": stuff })).setHeadername
value
Defined in
io/js/io-base.js:400
Stores default client headers for all transactions. If a label is passed with no value argument, the header will be deleted.
starttransaction
config
Defined in
io/js/io-base.js:232
Fires event "io:start" and creates, fires a transaction-specific
start event, if config.on.start is defined.
stringifyform
[options]
Provided by the io-form module.
Defined in
io/js/io-form.js:11
Enumerate through an HTML form's elements collection and return a string comprised of key-value pairs.
successtransaction
config
Defined in
io/js/io-base.js:284
Fires event "io:success" and creates, fires a transaction-specific "success" event, if config.on.success is defined.
transporto
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:264
Initializes the desired transport.
o
Object
transports.nodejsProvided by the io-nodejs module.
Defined in
io/js/io-nodejs.js:41
NodeJS IO transport, uses the NodeJS request module under the hood to perform all network IO.
This object contains only a send method that accepts a
transaction object, uri and the config object.
Y.io('https://somedomain.com/url', {
method: 'PUT',
data: '?foo=bar',
//Extra request module config options.
request: {
maxRedirects: 100,
strictSSL: true,
multipart: [
{
'content-type': 'application/json',
body: JSON.stringify({
foo: 'bar',
_attachments: {
'message.txt': {
follows: true,
length: 18,
'content_type': 'text/plain'
}
}
})
},
{
body: 'I am an attachment'
}
]
},
on: {
success: function(id, e) {
Y.log(e.responseText);
}
}
});
xdruri
o
c
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:157
Method for accessing the transport's interface for making a cross-domain transaction.
xdrReadyyid
uid
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:278
Fires event "io:xdrReady"
xdrResponsee
o
c
Provided by the io-xdr module.
Defined in
io/js/io-xdr.js:212
Response controller for cross-domain requests when using the Flash transport or IE8's XDomainRequest object.
_cBProvided by the io-xdr module.
Defined in
io/js/io-xdr.js:20
Map of stored configuration objects when using Flash as the transport for cross-domain requests.
_headers
Defined in
io/js/io-base.js:52
Object of IO HTTP headers sent with each transaction.
_qProvided by the io-queue module.
Defined in
io/js/io-queue.js:11
Array of transactions queued for processing
_qStateProvided by the io-queue module.
Defined in
io/js/io-queue.js:23
Property to determine whether the queue is set to 1 (active) or 0 (inactive). When inactive, transactions will be stored in the queue until the queue is set to active.
_rSProvided by the io-xdr module.
Defined in
io/js/io-xdr.js:30
Map of transaction simulated readyState values when XDomainRequest is the transport.
_timeout
Defined in
io/js/io-base.js:63
Object that stores timeout values for any transaction with a defined "timeout" configuration property.
_transportProvided by the io-xdr module.
Defined in
io/js/io-xdr.js:118
Map of io transports.
delayProvided by the io-xdr module.
Defined in
io/js/io-xdr.js:304
Delay value to calling the Flash transport, in the event io.swf has not finished loading. Once the E_XDR_READY event is fired, this value will be set to 0.
io:complete
Defined in
io/js/io-base.js:258
Signals the completion of the request-response phase of a transaction. Response status and data are accessible, if available, in this event.
io:failure
Defined in
io/js/io-base.js:311
Signals an HTTP response with status outside of the 2xx range. Fires after io:complete.
io:progress
Defined in
io/js/io-base.js:331
Signals the interactive state during a file upload transaction. This event fires after io:start and before io:complete.
io:success
Defined in
io/js/io-base.js:293
Signals an HTTP response with status in the 2xx range. Fires after io:complete.
io:xdrReadyProvided by the io-xdr module.
Defined in
io/js/io-xdr.js:14
Fires when the XDR transport is ready for use.