I have an ajax
request:
$.ajax({
url:
'DBConnector.php',
type: 'GET',
dataType:
'json',
success: function(data){
//check if
exist
}
});
This
is what i return:
echo
json_encode(array("data" => $returnValue , "status" =>
"false"));
How
to check if status exist(not to be false but really if it
exist)?
Answer
You can try the
following:
$.ajax({
url: 'DBConnector.php',
type: 'GET',
dataType: 'json',
success: function(data)
{
if(data.status !==
undefined)
{
//YOUR CODE HERE
}
}
});
It
will check if the status
exists or
not.
No comments:
Post a Comment