【发布时间】:2012-03-10 00:18:49
【问题描述】:
我无法获取通过 AJAX 调用返回的响应 JSON 数据。这是我在 firebug 中得到的结果。
{"COLUMNS":["ID","NAME","REGION","EMAIL"],"DATA":[["1234","John Doe","West","johndoe@mydomain.com"]]}
这是我的脚本:
$.ajax({
url: "action.cfc?method=getEmployees&returnformat=json&queryFormat=column", type: "POST",
success: function(response){
console.log(response);// is the data above
console.log(response.DATA.NAME[1]); // this doesn’t work
console.log(response.DATA['NAME']);//and this doesn’t work
}
});
尝试控制台记录名称时,我在 fireBug“response.DATA 未定义”中收到此错误。我错过了什么?提前感谢您的帮助!
【问题讨论】:
标签: jquery json coldfusion