In php I have the following return:
$invalido = (object) array(
'invalido' => true
);
echo json_encode($invalido);
I need to display in success
of ajax
asked if invalido
is true
.
I've tried the following:
success: function(data) {
//alert(data);
if(data.invalido == true)
{
alert('invalido');
}
}
You are not entering if, and the top alert is displaying the following:
{"invalido":true}{"scalar":false}
How do I validate what's coming in invalido
?
I need to access what's coming in this json
, access invalido
:
{"invalido":true}{"scalar":false}