Я выполняю вызов POST
и хочу обработать error
, однако обратный вызов success
не вызывает, если не введен параметр 'type'.
Я пыталсяследующими способами.
Это работает, но так как я также хочу обработать часть ошибки, я не могу использовать это.
$.post(myurl, {
mydatatobesent
}, function(resp) {
console.log("done is called");
resolve(true);
}, "text");
Другие испытания:
$.post(myurl, {
mydatatobesent
}, function(resp) {
console.log("done is called");
resolve(true);
}, function(error) {
console.log("error is called");
reject(error);
}, "text");
$.post(myurl, {
mydatatobesent
}, function(resp) {
console.log("done is called");
resolve(true);
}, "text", function(error) {
console.log("error is called");
reject(error);
});
$.post(myurl, {
mydatatobesent
}).done(function(resp) {
console.log(resp)
}).fail(function(fail) {
console.log(fail
});
$.post(myurl, {
mydatatobesent
}, "text").done(function(resp) {
console.log(resp)
}).fail(function(fail) {
console.log(fail
});
ОБНОВЛЕНИЕ : На последнем испытании вызывается обработчик fail
.
CONSOLE

ОБНОВЛЕНИЕ
