Answer the question
In order to leave comments, you need to log in
Why doesn't reload after AJAX work?
Ajax processes the form and reloads the page under certain conditions.
The question is a little not correctly asked, the reload occurs, but the data change is not taken into account.
The user is authorized in Ajax, but the page thinks not when reloading.
On restart everything is fine.
$('#check_phone').click(function(){
if($('#ok').val() == phone_ok){
var $that = $('.login_form');
formData = new FormData($that.get(0));
$.ajax({
url: '/local/ajax/auth/check_phone.php', // путь к php-обработчику
type: 'POST', // метод передачи данных
dataType: 'json', // тип ожидаемых данных в ответе
data: formData,
complete: function(data) {
if (data) {
// проверка на ошибки
if(data.errors){
alert(data.errors);
}
else{
window.location.href = window.location.href;
}
}
}
});
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question