All over again.
$ git clone git://github.com/ded/reqwest.git
$ cd reqwest
$ npm install --dev
$ npm run-script boosh
reqwest('path/to/html', function (resp) {
qwery('#content').html(resp);
});
reqwest({
url: 'path/to/json',
type: 'json',
method: 'post',
success: function (resp) {
qwery('#content').html(resp.content);
},
failure: function (err) { }
});
reqwest({
url: 'path/to/data.jsonp?callback=?',
type: 'jsonp',
success: function (resp) {
qwery('#content').html(resp.content);
}
});
reqwest({
url: 'path/to/data.jsonp?foo=bar',
type: 'jsonp',
jsonpCallback: 'foo',
success: function (resp) {
qwery('#content').html(resp.content);
}
});
npm test
open http://localhost:1234
- IE6+
- Chrome 1+
- Safari 3+
- Firefox 1+
- Opera
Reqwest can be used as an Ender module. Add it to your existing build as such:
$ ender add reqwest
Use it as such:
$.ajax({ ... });
$(form).serialize();
Happy Ajaxing!