JS 获取json长度
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));