标签:
var keleyijson={"plug1":"myslider","plug2":"zonemenu","plug3":"keleyi"} function JSONLength(obj) { var size = 0; var key; for (key in obj) { //obj中存在几个关键字 if (obj.hasOwnProperty(key)) size++; } return size; }; document.write("json对象的元素个数是:"+JSONLength(keleyijson));
标签:
原文地址:http://www.cnblogs.com/fanxiaowu/p/4464386.html