Я обновил jquery до более новой версии в старом файле, в котором были добавлены новые функции. Теперь почта jquery ajax перестала работать. Я попытался изменить успех, но это не разобрало проблему.Ajax-запрос работает со старыми версиями jquery not new
// check email in database
$("#email_address").change(function() //this function needs tidying up!
{ //if theres a change in the email textbox
var email_address = $("#email_address").val(); //Get the value in the username textbox
if (email_address.length > 3) //if the lenght greater than 3 characters
{
$("#availability_status").html('<img src="../img/loader.gif" align="absmiddle"> Checking this email is not already registered<br />'); //Add a loading image in the span id="availability_status"
$.ajax({ //Make the Ajax Request
type: "POST",
url: "../ajax_check_email.php", //file name
data: "email_address=" + email_address, //data
success: function (server_response) {
$("#availability_status").ajaxComplete(function (event, request) {
if (server_response == '0') //if ajax_check_email.php return value "0"
{
$("#availability_status").css("display", "none");
} else if (server_response == '1') //if it returns "1"
{
$("#availability_status").css("display", "inline");
$("#availability_status").html('<font color="red">This email address is already registered in our database. </font>');
}
});
}
});
}
return false;
});
Я полностью удалил .ajaxComplete(), и он сработал. Благодарю. – JakeKempo