How to make an AJAX request with YUI IO.
js/io.js
[crayon language="javascript"]
YUI().use(‘io’, function (Y) {
var uri = ‘test.txt’;
var cfg = {
method: ‘GET’,
data: ‘id=4′,
on: {
success: successHandler
},
arguments: {
key1: ‘one’,
key2: ‘two’
}
};
Y.io(uri, cfg);
function successHandler(id, res, args) {
console.log(args);
}
});
[/crayon]
Recent Comments