Simple jQuery parses json data and jquery parses json data
Respect for labor results, reproduced please indicate the source (http://blog.csdn.net/sllailcp/article/details/41113275 )...
JQuery needs to introduce some json data.
Complete case <! Doctype html> <Script type = "text/javascript" src = "jquery-1.7.2.min.js"> </script>
<Script type = "text/javascript"> $ (function () {var province_enum = [{id: 1, name: 'beijing', city: [{id: 1, name: 'beijing', district: [{id: 1, name: 'dongcheng district '}, {id: 2, name: 'xicheng district'}, {id: 3, name: 'chongwen region'}, {id: 4, name: 'xuanwu region'}, {id: 5, name: 'chaoyang district '}, {id: 6, name: 'fengtai district '}, {id: 7, name: 'shijingshan district'}, {id: 8, name: 'haidian district '}, {id: 9, name: 'mentougou district '}, {id: 10, name: 'fangshan district'}, {id: 11, name: 'tongzhou district '}, {id: 12, name: 'shunyi district '}, {id: 13, name: 'changping district'}, {id: 14, name: 'daxing district '}, {id: 15, name: 'huairou region'}, {id: 16, name: 'pinggu region'}, {id: 17, name: 'miyun region'}, {id: 18, name: 'yanqing County '}]}, {id: 2, name: 'tianjin', city: [{id: 2, name: 'tianjin ', district: [{id: 19, name: 'heping region'}, {id: 20, name: 'hedong region'}, {id: 21, name: 'hexi region'}, {id: 22, name: 'nankai district '}, {id: 23, name: 'hebei district'}, {id: 24, name: 'hongqiao district '}, {id: 25, name: 'tanggu region'}, {id: 26, name: 'hanggu region'}, {id: 27, name: 'dagang region'}, {id: 28, name: 'dongli district '}, {id: 29, name: 'xiqing district'}, {id: 30, name: 'jinnan district '}, {id: 31, name: 'beichen region'}, {id: 32, name: 'wuqing region'}, {id: 33, name: 'baodi region'}, {id: 34, name: 'ninghe County '}, {id: 35, name: 'jinghai County'}, {id: 36, name: 'yixian County '}]},] for (var x = 0; x <province_enum.length; x ++) {document. write ('province: '+ 'id:' + province_enum [x]. id + ',' + 'name: '+ province_enum [x]. name + '<br>') for (var y = 0; y <province_enum [x]. city. length; y ++) {document. write ('city: '+ 'id:' + province_enum [x]. city [y]. id + ',' + 'name: '+ province_enum [x]. city [y]. name + '<br>') for (var z = 0; z <province_enum [x]. city [y]. district. length; z ++) {document. write ('area: '+ 'id:' + province_enum [x]. city [y]. district [z]. id + ',' + 'name: '+ province_enum [x]. city [y]. district [z]. name + '<br> ')}}}
}); </Script> <Body> <a href = "http://blog.csdn.net/sllailcp/article/details/41113275"> respect the fruits of labor, repost please indicate the source </a>
</Body> :