I am checking if username exists live from the database if it is the username is not available, the response is Inavailable and vice versa. Am getting this response successfully but I cannot match this response string so that I display different details to the user. This is my Jquery Ajax function
var dataString = 'user_name=' + username;
$.ajax({
type: "POST",
url: "ajax_scripts/checkUser.php",
data: dataString,
cache: false,
success: function(response) {
if(response=="Available")
{
alert("The server data matched");
}
else if(response=="Inavailable") {
alert("The server data did not match");
}
}
});
I cannot match the server resposne. Kindly assist me i am beggining to learn jquery ajax