function 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:区县
}
2023-01-08 09:34:47
function 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:区县
}