I've another problem. I get an error in FireFox and I don't know what my fault is. I always did it like this way and I never got an error. I already check lower/uppercase mistakes but I can't find anything.
Thanks
$.ajax({type: "POST", url: "ajax/check_username.php", data: {username: username}}).done is not a function
<script type="text/javascript">
$(document).ready(function(){
$("#username").keyup(function(){
var username = $("#username").val();
$(".usernameFeedback").fadeIn("fast");
$.ajax({
type: "POST",
url: "ajax/check_username.php",
data: { username: username }
}).done(function( msg ) {
$("#loadingImage").hide();
if(msg.status != "error")
{
if(msg.available == "yes")
{
$(".usernameFeedback span").text(msg.message);
$(".usernameFeedback span").removeClass("notok");
$(".usernameFeedback span").addClass("ok");
}
else
{
$(".usernameFeedback span").text(msg.message);
$(".usernameFeedback span").addClass("notok");
}
}
});
return(false);
})
});
</script>
Probably your jQuery version is too old. You need at least jQuery 1.5 for jqXHR objects to implement the Promise interface you are using.
If you cannot upgrade for some reason, simply use the success
option:
$.ajax({
type: "POST",
url: "ajax/check_username.php",
data: { username: username },
success: function(msg) {
}
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With