3
I have a simple ajax like this:
function ajax() {
$.ajax({
url: "../../api/utilitarios/cidades/estado",
method: 'POST',
dataType: 'json',
success: function (data) {
},
error: function (data) {
console.log(data);
}
});
}
It has a Success and an error, I need to know when the ajax request has been completed and everything is ready to be printed ?
Currently I use a setTimeout within Success, but if it takes more than that it will mess up my script....
In the documentation Always performs on success and error and then executes success, error and progress. so I believe that the then is a more complete solution.
– Gabriel Rodrigues