I have a code:
req = new AjaxAdapter;
req.dataType = 'json';
return req.query('GET', url, request, function(responseServer, status, xhr) {
var json;
json = responseServer.data;
return response(json);
}, function(jqXHR, textStatus, errorThrown) {
var exception;
exception = jQuery.parseJSON(jqXHR.responseText);
return showError(exception);
});
And I don’t understand it. So what is the query() function? I can’t find it in the jQuery documentation. See in my example that this function has 5 parameters:
- get
- url
- request
- function which return data (response)
- function which is call when is error
What is request? Where I can found documentation of the query() function?
This isn’t jQuery. As for what the
querymethod does, look at its signature:It takes the post-type as the first parameter, a URL as the second, your request data as the third, and a callback function when the request completes.
Your callback returns the server’s response, a status code indicating the type of response, as well as the XHR object the query method used to issue the request.