function printObject(obj) {
//obj = {"cid":"C0","ctext":"区县"};
var temp = "";
for (var i in obj) { //用javascript的for/in循环遍历对象的属性
temp += i + ":" + obj[i] + "
";
}
//alert(obj); //结果:[object Object]
//console.log(obj); //使用firebug查看结果
alert(temp); //结果:cid:C0
ctext:区县
}
---------------------
作者:mezheng
来源:CSDN
原文:https://blog.csdn.net/mezheng/article/details/78538373
版权声明:本文为博主原创文章,转载请附上博文链接!