appcelerator titanium cannot parse JSON -
i'm new titanium , difficulty in parsing json mysql export. json valid , feel frustrated many unsuccessful trials. simplify code, put below. code stop , said: [error] script error = unable 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);
thanks & regards, richard
the json invalid. single quotes should double quotes.
a common mistake.
Comments
Post a Comment