Вызов ф-ии:
ajaxRequest("user.get", formData);
Сама ф-я
function ajaxRequest(method, data) {
xhr_ajax = $$.ajax({
url: "https://***/" + method,
method: "POST",
crossDomain: true,
data: "data=" + data,
error: function (response) {
myApp.hideProgressbar();
},
success: function (response) {
console.log("Ответ скрыт");
ajax_response(method, JSON.parse(response));
response = null;
},
complete: function (response) {
myApp.hideProgressbar();
},
error: function (response) {
alert("ВСЕ!");
},
start: function (response) {
console.log("Начал!");
}
});
}