unction printObject(obj){
//obj = {"cid":"C0","ctext":"区县"}; var temp = ""; for(var i in obj){//用javascript的for/in循环遍历对象的属性 temp += i+":"+obj[i]+"\n"; } alert(temp);//结果:cid:C0 \n ctext:区县 }本文共 248 字,大约阅读时间需要 1 分钟。
unction printObject(obj){
//obj = {"cid":"C0","ctext":"区县"}; var temp = ""; for(var i in obj){//用javascript的for/in循环遍历对象的属性 temp += i+":"+obj[i]+"\n"; } alert(temp);//结果:cid:C0 \n ctext:区县 }转载于:https://www.cnblogs.com/forthelichking/p/6070740.html