【发布时间】:2016-04-27 23:39:39
【问题描述】:
我正在向我去年编写的应用程序添加新功能,现在正在工作......我只是将代码从 Appcelerator (3.2...) 移植到 Appcelerator Studio 5.2.0.GA SDK ...花了 2 天时间试图弄清楚为什么当前在应用商店中的应用上运行的代码在 SDK 5.2.0 环境中无法运行
我不断收到上述错误.. 我很肯定 url 是正确的并且可以正常工作
这行代码现在可以在商店的应用程序和 3.1 中使用...但在 5.2.0 中无法使用
var jsonObject = JSON.parse(this.responseText);
它给出了上述错误 "JSON 解析错误:意外的标识符 \"undefined\"";
我已阅读他们的网站并寻找解决方案...谢谢 整个区块
【问题讨论】:
-
你的“JSON”中有
undefined吗?这不是有效的 JSON。 -
尝试使用
this.responseData而不是this.responseText: docs.appcelerator.com/platform/latest/#!/api/…。在执行 JSON.parse 之前,尝试记录响应以查看它是否是有效的 JSON:Ti.API.log('this.responseText ' + this.responseText);
标签: json appcelerator appcelerator-titanium