post

sends a POST AJAX request to the server

promise post(string url, [object params,function callback] );
url
stringthe URL to load params
objectthe object with parameters to send to the server callback
functionoptional callback function
promise"promise" of the object with the methods for getting data

Example

webix.ajax().post('data.php', { filter : '123' }).then(function(data){
    // response
    console.log(data.text());
});

Details

Callback

The callback function receives 3 parameters:

Return value

The method returns a promise object than contains the eventual result of the AJAX request. A promise can be used instead of callbacks. The function inside the then() of a promise receives the result parameter - the object that has the following methods:

webix.ajax().post('data.php', { filter : '123' }).then(function(result){
    console.log(result.json());
}).fail(function(xhr){
    var response = JSON.parse(xhr.response);
    webix.message({type: 'error', text: response.error.message});
});

More information on Webix and Promiz.js usage can be found at:

See also
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.