json 与 xml的对比

xml

 <province>
        <name>新疆</name>
        <citys>
            <city>乌鲁木齐</city>
        </citys>
    </province>

json

可读性高

var country =
    {
        name: "中国",
        provinces: [
            { name: "黑龙江", citys: { city: ["哈尔滨", "大庆"]} },
            { name: "广东", citys: { city: ["广州", "深圳", "珠海"]} },
            { name: "台湾", citys: { city: ["台北", "高雄"]} },
            { name: "新疆", citys: { city: ["乌鲁木齐"]} }
        ]
    }

猜你喜欢

转载自blog.csdn.net/qq_32048015/article/details/88799722