首页 > 其他 > 详细

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

时间:2017-12-14 11:43:17      阅读:373      评论:0      收藏:0      [点我收藏+]

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"
 
 
 

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

原文:http://www.cnblogs.com/royal-salute/p/8036716.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!