Okay, So I'm pretty sure that I'm doing everything right here, but the trouble is, in the data response I get, I simply can't access !
alert(data) gives me [object Object]
alert(data.email) gives me undefined
console.log(typeof(data)) gives me object
console.log(typeof(data.email)) gives me null
In firebug, I can see the json is correct... I Have no idea what's going on, and am in urgent need of any help!!!!
Would be very apprieciated... PS. sorry about the bad formatting below!
$.ajax({
url: "processsignup.php",
type: "POST",
data: $('#signup').serialize(),
dataType: "json",
statusCode: {
400: function(data) {
if(data.email != "ok")
$('#SignUpMessageAfter').html(data.email);
},
500: function() {
$('#SignUpMessageAfter').html("An error has occured. Please try again");
}
}
});