您好,这是我来自 ajax 调用的 json 响应:
[{"id":null,"period":null,"until":null,"agent_id":"15","agent_zlecajacy_id":"15","offer_id":null,"status":"1","tytul":"Pobranie ksi\u0105g","tresc":"Pobranie ksi\u0105g","data_aktualizacji":"2013-10-21","data_kontaktu":"2013-10-08 22:00:00","data_kontaktu_end":"0000-00-00 00:00:00","czas_minuty":"30","created":"2013-10-21","type":"todo","series":null,"offers":"","details":"","parent_id":"0","assignment":null,"color":null,"asigned_users":null,"e_type":null,"show":null}]
如何获得例如状态为“1”的状态,我尝试了 $.parseJSON(result),但得到
SyntaxError: JSON.parse: unexpected character
也许是因为有空值?
这是更多代码
url: "/schedule/getDetails/?id="+event_id,
dataType: 'json',
async: false,
success : function(json) {
result = json.result;
console.log($.parseJSON(result));
和 php (zend)
$result = $model->getDetails($id);
$this->sendJSON($result);