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:区县
}
时间: 2024-10-18 05:14:59
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:区县
}