1
I have a very simple AJAX request. But I wonder if you can read the status code returned within the method done
. More or less like below:
$('#form-aluno').submit(() => {
let data = $('#form-aluno').serialize();
const register = $.ajax({
method: "post",
url: "/alunos/register/save",
dataType: "json",
data: data
})
register.done((e) => {
console.log(e.statusCode) //tem como fazer algo do tipo ou similar ?
})
return false;
})
Ajax implements so Xmlhttprequest. See here to use this simply and read the codes. https://www.w3schools.com/js/js_ajax_http.asp
– Peter