{success:"true",data:{"obj.cacheId":1,"obj.cacheType":1,"obj.deviceName":"","obj.id":2880,"obj.pop":{"caches":[],"description":"昌平POP","domain":null,"domainId":1,"id":100024546,"isMonitor":1,"monitorTime":"","name":"昌平","oprStatus":1,"popIp":"","popMode":1,"priority":0,"protocolType":1,"runStatus":1},"obj.popId":0,"obj.priority":1}, msg:"",error:""}取obj.pop里name的值?
1 回答
莫回无
TA贡献1865条经验 获得超7个赞
javascript 获取jason值:
var jsonData;
$.ajax({
type: "Get", //请求的方法
url: "../public/dataaccess/rain/RainAreaMaxDataProvider.ashx?adomParameter=" + Math.floor(Math.random() * 1000 + 1), //要传递参数使用Ajax进行处理的类名称
dataType: "text", //返回的数据类型
global: false, //Ajax的范围
async: false, //异步执行
//成功情况下的处理
success: function (strReult) {
jsonData=eval("("+strReult+")");
// var f= jsonData.AreaMax.data[0].AREA;
}, //失败情况下的处理
error: function () {
alert("Ajax请求数据失败!");
}
});
//循环读取
for(var i=0;i<jsonData.AreaMax.data.length;i++){
rainAreaMaxHtml+=jsonData.AreaMax.data[i].AREA+jsonData.AreaMax.data[i].STNM+jsonData.AreaMax.data[i].VAL;
}
添加回答
举报
0/150
提交
取消