I’m trying to check the value inside a condition statement after it comes back from the server, but it doesn’t seem to be working as expected. For debugging I’m checking the value with an alert statements and that value is what i’m expecting, but it doesn’t seem to work inside of the condition statement.
$.ajax({
type: "POST",
url: "scripts/process-step1.php",
data: $('.home1').serialize(),
success: function(msg){
alert(msg); // remove after testing
if (msg === 'Life' ){
document.location.href = 'form-life.php';
}
else{
document.location.href = 'form.php';
}
},
I have tried both
msg === 'Life'
msg == 'Life'
any ideas?