1 var str = '[{"uname":"王强","day":"2010/06/17"},{"uname":"王海云","day":"2010/06/11"}]'; 2 3 for(var i=0;i<jsonList.length;i++){ 4 5 6 for(var key in jsonList[i]){ 7 8 alert("key:"+key+",value:"+jsonList[i][key]); 9 10 } 11 12 }
1 var mapColumn = { 2 "vdoing" : "访问深度", 3 "_visitorNumber": "访问量", 4 "_pageViews": "浏览量", 5 "_jumpOutRate": "跳出率", 6 "_avgAccessTime": "平均访问时长", 7 "_allTargetConvRate": "转化率", 8 "_orderTotalPrice": "总收益" 9 10 }; 11 var target=[]; 12 for (var key in mapColumn) { 13 target.push(key); 14 }
1 function text(){ 2 var json = {"options":"[{"text":"王家湾","value":"9"},{"text":"李家湾","value":"10"},{"text":"邵家湾","value":"13"}]"} 3 json = eval(json.options) 4 for(var i=0; i<json.length; i++) 5 { 6 alert(json[i].text+" " + json[i].value) 7 } 8 }
本文转载于:http://qiaolevip.iteye.com/blog/1670967 好东西,权当作收藏