I'm having trouble comparing the result of an ajax call with a string. The ajax call is returning the correct result, but I'm struggling to get the if statement to properly compare it with my string. Any suggestions on how to approach this?
$.ajax({
type: "POST",
url: "sessionCheck.php",
data: {id:mwdata},
success: function(html) {
if (html == "open"){
alert ("Yes, it's open");
}else if(html == "closed"){
alert ("No, it's closed");
}
}
});