performs an async or sync ajax request
method | string | the method used for sending request, "GET" by default |
url | string | url to the server side |
data | string | the data sent to the server side by the POST-request |
async | boolean | the mode of sending data to a server, true by default |
callback | function | optional, a function to call after the response is loaded |
headers | object | optional, a set of headers, defined as "key":"value" pairs that should be sent with a request |
dhx.ajax.query({
method:"POST",
url:"some.php",
data:"k1=v1&k2=v2",
async:true,
callback:function(){},
headers:{
"MyHeader-Name1":"value1",
"MyHeader-Name2":"value2",
}
});
the headers param allows specifying additional Request Headers. This API can be used in quite specific cases, e.g. for loading data from third party API and data services.
added in version 4.1.2
Back to top