标签:
function save(){ var value2 = { "china":[ {"name":"hangzhou", "item":"1"}, {"name":"shanghai", "item":"2"}, {"name":"sichuan", "item":"3"} ], "America":[ {"name":"aa", "item":"12"}, {"name":"bb", "item":"2"} ], "Spain":[ {"name":"cc", "item":"1"}, {"name":"dd", "item":"23"}, {"name":"ee", "item":"3"} ] }; for (var countryObj in value2) { document.write(countryObj + ":<br />") for (var cityObj in value2[countryObj]) { //可以用document.write("-----" + value2[countryObj][cityObj].item + "<br />"); document.write(cityObj + " ++++++ " + value2[countryObj][cityObj]["name"] + "<br />" ); } } }
标签:
原文地址:http://www.cnblogs.com/estellez/p/4529902.html