Namespace: ajax

just.ajax(urlnon-null, fnopt, optionsopt) → {*}

Make a request using XMLHttpRequest.
Since:
1.0.0-rc.23
Source:
just.js, line 1831

Parameters:

NameTypeDescription
url
urlSome url.
fn
[optional]
just.request~fnHook for onreadystatechange listener.
options
[optional]
object

Properties

NameTypeDefaultDescription
method
[optional]
string"GET"An HTTP Request Method: GET, POST, HEAD, ...
json
[optional]
boolean/.json$/.test(url)If true, "Content-Type" will be set to "application/json", #responseType to "json", and the #response/#responseText will be parsed to a JSON.
data
[optional]
AnynullData to send.
send
[optional]
functionjust.request~sendA custom function to intercept and send the request.
async
[optional]
booleantrue"async" param for XMLHttpRequest#open().
user
[optional]
stringnullUser name to use for authentication purposes.
pwd
[optional]
stringnullPassword to use for authentication purposes.
props
[optional]
objectjust.request~defaultPropsProperties for the xhr instance.
headers
[optional]
objectjust.request~defaultHeadersCustom headers for the request.

Returns:

The retuned value of just.request~send.
Type
Any