Привет всем этим функциям обратного вызова в процессе ajax, которые обрабатывают различные аспекты процесса:
$.ajax({
url: 'url',
type: 'GET',
async: false,
beforeSend: function(){
console.log('before')
},
complete: function() {
console.log('completed')
},
success:function(data){console.log('success')
},error:function(err){
console.error(err.message || 'Something went wrong')
}
});
Надеюсь, это поможет.