appcelerator titanium cannot parse JSON
- by Richard
Hi,
I'm new to titanium and get difficulty in parsing JSON from mysql export. the json is valid and I feel frustrated with many unsuccessful trials. To simplify the code, I put it below. The code just stop and said:
[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);
Thanks & regards,
Richard