Simple jQuery parses json data and jquery parses json data

Source: Internet
Author: User

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> :


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.