Package Exports
- jajax.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jajax.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jAJAX 
jQuery-like AJAX method for multiple environments: browser, chrome-extension, safari-extension, firefox-extension.
You can use it even in Node.js with node-XMLHttpRequest.
Usage
jajax(options: object, ondone: function, onerror: function).then(onresolve, onreject)
/* where
* options is "url" or {url:"url", dataType:"type", method: "GET", ...}, similar to jQuery.ajax(options)
*
* function ondone(result, statusText, xhr[, response]);
* function onerror(xhr, type: "error"|"parsererror"|"abort"|"timeout"|"xhr", error[, response]);
* In Firefox there is response object instead of XHR, xhr is a plain object substitute
*/
The following expression could easilly replace jAJAX
when jQuery
is present:
var jajax = function (options, ondone, onerror) {
return jQuery.ajax(options).done(ondone).fail(onerror)
};
For more options see jQuery.ajax().
Features
- No external dependencies (no jQeury required)
- Small footprint (~ 2.5Kb minified and gziped)
- Easy to use (see jQuery.ajax())
- Works in Browser Extensions as well (tested in chrome-extension, safari-extension, firefox-extension)
- Can be used as a drop in replacement for jQuery.ajax()
License
MIT