1
我試圖解析JSON數據,以列出的Android應用 響應是如下解析JSON 2
{"records":[{"reg_no":"444444","name":"xyz, pqr","address":"Kathmandu-64, Kathmandu","sex":"Male","qualification":"B..E","university":"T.U","year":"2010","faculty":"Computer","date":"2012-08-17 11:29:38"}]}
煎茶代碼如下
{
xtype: 'nestedlist',
title: 'List',
iconCls: 'star',
displayField: 'name',
store: {
type: 'tree',
fields: [
'name', 'reg_no', 'faculty', 'address', 'university',
{name: 'leaf', defaultValue: true}
],
root: {
leaf: false
},
proxy: {
type: 'jsonp',
url: 'http://timus.com/api.php?name=serish',
reader: {
type: 'json',
rootProperty: 'records'
}
}
},
detailCard: {
xtype: 'panel',
scrollable: true,
styleHtmlContent: true
},
listeners: {
itemtap: function(nestedList, list, index, element, post) {
this.getDetailCard().setHtml(post.get('university'));
}
}
}
但不解析json ..後續錯誤即將到來
uncaught syntax error : unexpected token