simpleAjax - JavaScript Object
simpleAjax is a very small Ajax Javascript object (~2kb) with cross-browser support.
simpleAjax({
url: 'ajax.html',
type: 'GET',
success: function (data) {
alert(data);
}
});
There are 2 short ajax calls for GET and POST.
simpleAjax.get('ajax.html', function (data) {
alert(data);
});
simpleAjax.post('ajax.html', {val: 'test'}, function (data) {
alert(data);
});
With the simpleAjax.load()
function you can directly load the response into a DOM element.
simpleAjax.load('contentContainer', 'ajax.html');
simpleAjax( options )
simpleAjax.get( url, [data], [success] )
simpleAjax.post( url, [data], [success] )
simpleAjax.load( el, url, [data], [complete] )
Tested on IE7+, FF, Opera, Chrome and Safari (for Windows).
Released under MIT license.