I am using some jQuery post request, as so
$.post('url', {data: some_data}, function(data, textStatus, jqXHR) {
console.log(data); //to debug
console.log(data.status == "ok"); //to debug
....
});
the url hits some php method which returns with
echo json_encode(array('status' => 'ok'));
exit;
the problem is that console.log(data) returns {"status":"ok"} but console.log(data.status == "ok"); throws false. How can it be ?