Android 无法分析服务器返回的JSON
我看到错误:当我在android 2.3.5上使用Sencha Touch 2时,无法解析服务器返回的JSON。当我从桌面Chrome浏览器运行此应用程序时,它工作正常 我的Json是有效的:Android 无法分析服务器返回的JSON,android,json,sencha-touch-2,Android,Json,Sencha Touch 2,我看到错误:当我在android 2.3.5上使用Sencha Touch 2时,无法解析服务器返回的JSON。当我从桌面Chrome浏览器运行此应用程序时,它工作正常 我的Json是有效的: { "status": "OK", "result": [ { "key": "music", "count": 3 }, { "key": "cinema", "count": 13 }, { "
{
"status": "OK",
"result": [
{
"key": "music",
"count": 3
},
{
"key": "cinema",
"count": 13
},
{
"key": "theatre",
"count": 1
},
{
"key": "nightlife",
"count": 0
},
{
"key": "exhibition",
"count": 14
},
{
"key": "restaurant",
"count": 0
},
{
"key": "sport",
"count": 1
},
{
"key": "social",
"count": 2
},
{
"key": "conference",
"count": 4
},
{
"key": "festival",
"count": 0
},
{
"key": "other",
"count": 0
}
]
}
编辑:
我使用存储加载日期:
store.load({
callback: function (records, operation, success){
console.log('loaded');
},
scope: this
});
存储配置:
Ext.define('EIA.store.Categories', {
extend: 'Ext.data.Store',
config: {
model: 'EIA.model.Category',
proxy: {
type: 'ajax',
method: 'GET',
url: 'URL',
reader: {
type: 'json',
rootProperty: 'result'
}
}
}
});
我猜你在用商店。你能把它的代码添加到你的帖子里吗。或者您认为相关的任何其他代码。尝试将json作为文本文件从您的资产文件夹中读取。这是否有帮助:此解决方案适合我