我覺得我之前有過這個問題,但是我很難解析這個JSON響應。也許我只是有一個心理障礙。你們中的一個人能否指引我朝着正確的方向前進?解析JSON流
jQuery(function() {
//Conv Data
jQuery.ajax({
url: NewConvData,
dataType: 'json',
success: function (response) {
var channelHTML = '';
jQuery.each(response, function (i, item) {
channelHTML += '<tr><td class="tg-yw4l">' + item.call_mine_status + '</td><td class="tg-yw4l">' + item.cdr_source + '</td><td class="tg-yw4l">' + item.tracking_number + '%</td><td class="tg-yw4l">' + item.disposition + '</td><td class="tg-yw4l">' + item.duration + '</td><td class="tg-yw4l">' + item.external_id + '</td><td class="tg-yw4l">' + item.id + '</td><td class="tg-yw4l">' + item.is_outbound + '</td><td class="tg-yw4l">' + item.ouid + '</td><td class="tg-yw4l">' + item.repeat_call + '</td><td class="tg-yw4l">' + item.caller_id + '</td><td class="tg-yw4l">' + item.calldate + '</td><td class="tg-yw4l">' + item.ringto_number + '</td><td class="tg-yw4l"><a href="' + item.file_url + '">Recorded Call</a></td></tr>';
});
jQuery('#conv_table').append(channelHTML);
}
});
});
JSON響應看起來是這樣的:
{
"status": "success",
"matches": 1,
"results": [
{
"call_mine_status": "not mined",
"cdr_source": "CE",
"tracking_number": "9999999999",
"disposition": "ANSWERED",
"duration": 284,
"external_id": null,
"id": 25039100,
"is_outbound": 0,
"ouid": 49677,
"repeat_call": false,
"caller_id": "1234567891",
"calldate": "2015-12-01 13:50:03",
"ringto_number": "2223334444",
"title": null,
"user_id": null,
"scored": false,
"call_value": null,
"indicator": {
"active_indicators": [
],
"custom_indicators": [
]
},
"tagged": false,
"mine_error": "",
"call_recorded": "92cda5a0-3929-4773-9d4b-1a8deb14570c",
"postcall_response": [
{
"postcall_ivr_type": null,
"postcall_ivr_response": null
}
],
"postcall_option": [
{
"option_order": 1,
"details": [
{
"postcall_ivr_enabled": "false",
"postcall_ivr_tts": null,
"postcall_ivr_type": null,
"postcall_ivr_digits": null
}
]
}
]
}
],
"transaction_id": 354203610
}
究竟是什麼問題? – MorKadosh
'file_url'在您的JSON響應中不存在。 –
對不起,我在包含Jason數據的表中收到一個未定義的錯誤 – Phantom