请问在以下json字符串中怎么取得result的值
{"age":null,"city":null,"country":null,"falg":"成功","idCard":null,"list":null,"name":n...
{"age":null,"city":null,"country":null,"falg":"成功","idCard":null,"list":null,"name":null,"nickname":null,"phone":null,"result":"添加成功","sex":null,"userInfo":{"age":null,"appid":null,"assessor":null,"city":null,"country":null,"fall":null,"headimgurl":null,"id":74,"idCard":null,"name":null,"nickname":null,"phone":null,"province":null,"sex":null},"userInfoDao":{}}
展开
1个回答
展开全部
var str = '{"age":null,"city":null,"country":null,"falg":"成功","idCard":null,"list":null,"name":null,"nickname":null,"phone":null,"result":"添加成功","sex":null,"userInfo":{"age":null,"appid":null,"assessor":null,"city":null,"country":null,"fall":null,"headimgurl":null,"id":74,"idCard":null,"name":null,"nickname":null,"phone":null,"province":null,"sex":null},"userInfoDao":{}}';
var obj = eval("(" + str + ")");
obj["result"]
追问
success:function(json){
var obj= $.parseJSON(json);//使用这个方法解析json
var s=obj.result;//result 和action中定义的result变量的get方法对应的
//alert(s);
},我写的
这是ajax 怎么取出result的值,上面是firebug
的响应值
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询