Ext.Ajax.request({
url: "...",
method: "POST",
params: {
currentID: mainNode.attributes.id
},
success: function (response) {
var resp = Ext.decode(response.responseText );
resp.totalCount;
}
}); //ajax over
//响应中返回的
response.responseText : "{\"success\":\"true\",\"totalCount\":\"0\", \"root\":[]}"
通过Ext.decode(response.responseText);可以把返回的字符串转成对象
//decode后的效果
Ext.decode(response.responseText ) : {…}
root : []
success : "true"
totalCount : "0"
时间: 2024-10-12 22:34:10