ext 解析后台返回response.responseText中的数据


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"
 
 
 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM