1.0.0 • Published 6 years ago
@kempo/ajax v1.0.0
Ajax
A library that makes Ajax calls easy.
Ajax(method, url [, data [, callback [, headers]]])
: undefined
Makes an ajax request.
method
: string - The method to send the ajax request using, option are"get"
,"post"
,"put"
or"delete"
.url
: string - The url to send the ajax request to.data
: object - Any data you want to send as parameters.callback
: function - A function that will be called once the ajax request responds. The function should take two arguments, the first is a boolean indicating if the request was successfull or not, the second is a string (the response if it was successfull, or an error message if it was not successfull).headers
: object - An object contianing any additional headers you want to send in the request.
Ajax.get(url [, data [, callback [, headers]]])
: undefined
An alias of Ajax("get", url, data, callback headers)
.
Ajax.post(url [, data [, callback [, headers]]])
: undefined
An alias of Ajax("post", url, data, callback headers)
.
Ajax.put(url [, data [, callback [, headers]]])
: undefined
An alias of Ajax("put", url, data, callback headers)
.
Ajax.delete(url [, callback [, headers]])
: undefined
An alias of Ajax("delete", url, {}, callback headers)
.
1.0.0
6 years ago