我是钛新手,从 mysql 导出解析 JSON 时遇到困难。json 是有效的,我对许多不成功的试验感到沮丧。为了简化代码,我把它放在下面。代码只是停下来说:[ERROR] Script Error = Unable to parse JSON string
var win = Titanium.UI.currentWindow;
var hotdealjson = "{'hotdeal':[{'place':'bangkok','date':'4D3N','cost':'$4999up'},{'place':'tokyo','date':'3D2N','cost':'$3799up'}]}";
//read json
var response = JSON.parse(hotdealjson);
alert(response.hotdeal.length);
谢谢和问候,理查德