我必须像这样使用json文件:
({"weather":{"city":"Paris", "country":"France"}})
我将 JsonStore 编写为:
root : "weather",
fields : ['city', 'country']
我无法像这样访问它们:
myStore.on('load', function(store, records, options) {
alert(records[0].get('city'));
}
但是我怎样才能访问它们,因为我的 json 文件没有括号
另一种情况是当我想访问这样的东西时:
({"data":{"weather":[{ "city" : "Paris", "country" : [{"value" : "France"}] }]}})
我将根定义为“data.weather”
fields:['city','country']
但我无法访问国家/地区的价值
请描述 json 文件解析或者有没有办法将 json 文件加载为纯文本/文本?