ajax-sender
v1.3.1
Published
Send AJAX requests easily
Downloads
152
Readme
Ajax Sender (Demo)
Send AJAX requests easily
Doc
- Installation
Simply import AjaxSender into your HTML.
<script src="https://unpkg.com/[email protected]/AjaxSender.min.js"></script>
- How to use
Create a new AjaxSender
object with the URL as the first parameter :
let ajax = new AjaxSender('https://your.url', options);
// OR using await
let data = await new AjaxSender('https://your.url', {
...,
wait: true
}).asPromise().send();
- Options
{
method: 'GET',
data: { ... },
responseType: 'json',
wait: false, // Wait before sending the request ?
headers: { ... },
progress: response => { ... },
load: response => { ... },
error: response => { ... },
uploadProgress: response => { ... },
uploadLoad: response => { ... }
}
- Methods
See the documentation for the method definitions.
- Example
See this JSFiddle for a working example
Authors
- Zenoo - Initial work - Zenoo.fr