{ "10.10.11.1": { "target_1": "34.2", "target_3": "70.83", "target_2": "50.51", "target_5": "110.68", "c_event": "event", "target_4": "90.79", "c_timestamp": "12:54:34", "target_6": "10.2", "c_subject": "10.18.11.0" } }
{string,map<String,String>}类似这种格式
js函数:
function getValue(){ var str = '{ "10.10.11.1": { "target_1": "34.2","target_3": "70.83","target_2": "50.51"}}'; var map = eval("("+str+")"); for (var key in map) { var a = map[key]; for (var k in a) { alert(k+'---'+a[k]); } } }
js解析json,js转换json成map,获取map的key,value
原文地址:http://blog.csdn.net/u010697983/article/details/40430253