查看对象内容

时间:2021-09-15 12:40:34   收藏:0   阅读:19

一、查看对象内容(一级对象)。

for(i in test ){
alert(i); //获得属性
alert(test[i]); //获得属性值

}

二、查看对象里的对象(二级及以上)

for(i in test ){
alert(i);
alert(test[i].toSource());

}

原文:https://www.cnblogs.com/sonsmart/p/15265621.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!