首页 > 代码库 > jq中获取object 的键值key

jq中获取object 的键值key

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:区县
}

jq中获取object 的键值key