AjaxOptions
Defined in: utilities/ajax/ajax.ts:13
Settings for Ajax. Only url is required.
Properties
Section titled “Properties”
optionalcors?:boolean
Defined in: utilities/ajax/ajax.ts:49
Makes a cross-domain request with credentials: it sets xhr.withCredentials,
which sends cookies. The server must then answer with
Access-Control-Allow-Credentials: true and a specific origin, not *.
A request to a server that allows any origin needs no option at all.
Default Value
Section titled “Default Value”false
optionaldata?:string|object|null
Defined in: utilities/ajax/ajax.ts:60
Data to send: an object of names and values, which is URL-encoded (see urlParams), or a query
string that is already encoded ('a=1&b=2', without the ?).
It is sent as the body for POST, PUT and DELETE, and added to the URL as query parameters for GET
and JSONP.
Default Value
Section titled “Default Value”null
error?
Section titled “error?”
optionalerror?:AjaxCallback
Defined in: utilities/ajax/ajax.ts:72
Called when the request fails (any other status). Not used for JSONP.
headers?
Section titled “headers?”
optionalheaders?:Record<string,string>
Defined in: utilities/ajax/ajax.ts:30
Headers to add to the request, with xhr.setRequestHeader(name, value). They are added to the default
ones, and a header with the same name (the case does not matter) replaces the default.
Default Value
Section titled “Default Value”{ 'Content-type': 'application/x-www-form-urlencoded' }
jsonpCallback?
Section titled “jsonpCallback?”
optionaljsonpCallback?:string
Defined in: utilities/ajax/ajax.ts:66
JSONP only: the name of the global function the response calls.
It is added to the URL as callback=<name>.
method?
Section titled “method?”
optionalmethod?:AjaxMethod|"get"|"post"|"put"|"delete"|"jsonp"
Defined in: utilities/ajax/ajax.ts:22
The type of request. Case does not matter. An unknown method falls back to GET.
Default Value
Section titled “Default Value”'GET'
responseType?
Section titled “responseType?”
optionalresponseType?:XMLHttpRequestResponseType
Defined in: utilities/ajax/ajax.ts:39
Format of xhr.response. See
XMLHttpRequest.responseType.
An empty value falls back to 'text'.
Default Value
Section titled “Default Value”'text'
success?
Section titled “success?”
optionalsuccess?:AjaxCallback
Defined in: utilities/ajax/ajax.ts:69
Called when the request succeeds (status 200 to 299). Not used for JSONP.
url:
string
Defined in: utilities/ajax/ajax.ts:15
Request URL.