jquery获取json对象的key和value
json对象:var z = {"收藏关注":"/user/home","账户管理":"test"}
获取key以及value:
$.each(z, function(i) {
console.log(i); //获取键值
console.log(z[i]); //获取对应的value
});
for (var key in z) {
console.log(key); //获取key值
console.log(z[key]); //获取对应的value值
}
参考 https://blog.csdn.net/qq_33734225/article/details/77748525