easy-ajax
Simple wrapper functions for XMLHttpRequest.
Installation
npm install easy-ajax
Usage
var ajax = ;
var requestObject = ;
var requestObject = ;
var requestObject = ajax;
var requestObject = ajax;
var requestObject = ajax;
var requestObject = ajax;
requestObject
: XMLHttpRequest instance.method
: HTTP method: "GET", "POST", ...options
: Configuration object:timeout
: Timeout in ms.data
: Data to send (when POSTing).randomize
: Add a random query string to prevent caching?before
: A function to call after opening and before sending the request; called with the XMLHttpRequest object as the first argument.headers
: A hash object with additional headers to set; the keys are the header names, the values the values to set for the header.
then
: Callback for when the request is finished.
{ /* ... */ }
error
: AnError
instance ornull
when there are no errors.requestObject
: The finishedXMLHttpRequest
instance.