Class: AjaxSender

AjaxSender(url, parametersopt)

AjaxSender Class used to handle ajax calls

Constructor

new AjaxSender(url, parametersopt)

Creates an instance of AjaxSender
Parameters:
Name Type Attributes Description
url String URL to send the call to
parameters Object <optional>
Request parameters
Properties
Name Type Attributes Default Description
method String <optional>
GET Request method
data Object | FormData <optional>
Request data
responseType String <optional>
json Request response type
headers Object.<String, String> <optional>
Request headers
progress eventCallback <optional>
Callback for the progress event
load eventCallback <optional>
Callback for the load event
error eventCallback <optional>
Callback for the error event
uploadProgress eventCallback <optional>
Callback for the upload progress event
uploadLoad eventCallback <optional>
Callback for the upload progress event
wait Boolean <optional>
Don't send the request right away (enables the use of asPromise)
Source:

Members

xhr :XMLHttpRequest

The request corresponding XMLHttpRequest
Type:
Source:

Methods

asPromise() → {AjaxSender}

Sets the .send() return type to a Promise
Source:
Returns:
The current AjaxSender
Type
AjaxSender

send() → {AjaxSender|Promise}

Send the request (if wait == true in init)
Source:
Returns:
The current AjaxSender OR a Promise
Type
AjaxSender | Promise

stop() → {AjaxSender}

Stops any outgoing request
Source:
Returns:
The current AjaxSender
Type
AjaxSender