双map获得key ,value
前端获得格式
[
{"a1":{"name1":"name1","age1":"18"},
{"a2":{"name2":"name2","age2":"18"}
]
for(var i=0 ;i<mapData.length;i++){
for (var key in mapData[i]) {
var field =mapData[i][key];
// console.log("---- field"+field);
if(key=='a1'){
var json = eval("(" + field + ")");
// console.log("---- json"+json);
$.each(json, function (key, value) {
//获得a1中的key和value
}
}
}
}