15 – YUI 3.5 Javascript IO

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]

Leave a Reply

  

  

  

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>