This is the success callback of a jQuery ajax function:
success: function(data){
console.log(data);
if(data.error==1){
$("#error").show();
}else{
console.log("sucess");
//window.location=staticData.main;
}
}
this is the json that im getting from the server:
{"error":1}
on Chrome I get an error but on firefox it always shows success.
Are you sure that’s a json object or just a string representing a json object??
I would try this:
Hope this helps, alternatively you could create a jsbin with the actual ajax response in a variable and we could help you figure this out. Cheers!