I have something like this, where it is a simple call to a script that gives me back a value, a string but when i use alert function than it display correct value but after if condition it didn't showing the alert message. I just want to compare the value of data to the value that is coming from login.php.
$("#login").click(function(event){
event.preventDefault();
var Email = $("#email").val();
var Password = $("#password").val();
$.ajax({
url : "include/login.php",
method : "POST",
data : {CustomerLogin:1,CustomerEmail:Email,CustomerPassword:Password},
success : function(data){
if(data == 'true'){
alert(data);
}
}
})
})