【发布时间】:2013-09-04 10:51:18
【问题描述】:
我是 Sencha Touch 的新手。我尝试使用 Web 服务,但它一直说“无法使用提供的配置加载数据。在浏览器中打开”。我的店铺是
Ext.define('MyApp.store.MyJsonPStore', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.MyModel'
],
config: {
autoLoad: true,
model: 'MyApp.model.MyModel',
storeId: 'MyJsonPStore',
proxy: {
type: 'jsonp',
url: 'http://api.twitter.com/1/statuses/public_timeline.json',
reader: {
type: 'json',
rootProperty: 'errors'
}
}
}
});
我的模型是
Ext.define('MyApp.model.MyModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'message'
},
{
name: 'code'
}
]
}
});
提前感谢您的帮助。
【问题讨论】:
-
如果您按照代码中的 URL,它会以一些 JSON 响应:“Twitter REST API v1 不再活动”。
-
是的,但它给出了 JSON 响应。还尝试使用 bitcoincharts.com/t/markets.json 。以相同的错误结束。
-
可能想看到这个答案:stackoverflow.com/questions/5359224/…
标签: extjs sencha-touch jsonp extjs-mvc sencha-architect