var obj = {"id": 1, "name":"张三"}; for(var key in obj) { alert("Key是:" + key); alert("对应的值是:" + obj[key]); }
json遍历获取KEY
最新推荐文章于 2024-07-14 03:54:49 发布
var obj = {"id": 1, "name":"张三"}; for(var key in obj) { alert("Key是:" + key); alert("对应的值是:" + obj[key]); }