【发布时间】:2014-06-17 08:37:39
【问题描述】:
ColdFusion 的 serializeJSON 函数发送如下字符串:
{"COLUMNS":["COURSE","CONTID","CODE"],"DATA":[["Texting 101",41867,"T043"]]}
如何巧妙地使用 javascript 访问数据?
var response = JSON.parse(this.responseText);
console.log(response["CODE"]); // this doesn't work of course, but is there any way?
console.log(response.DATA[0][1]) // this works but it's not readable
是否可以使用列名而不是数组位置来访问 JSON 数据?这是给 Titanium Studio 的,所以我可以访问节点(如果这对我的事业有帮助的话)。
【问题讨论】:
-
试试
serializeJSON(queryObj, true)- cfdocs.org/serializejson
标签: javascript json node.js coldfusion titanium