欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

Ajax请求内嵌套Ajax请求示例代码

程序员文章站 2023-11-14 19:52:16
前段时间做项目,需要把全国省市的两个xml文件整合成一个json格式的数据,手写的话觉得数据太多了,而且容易出错,于是就想到了用ajax嵌套的方法来解决,就想平时用ajax...

前段时间做项目,需要把全国省市的两个xml文件整合成一个json格式的数据,手写的话觉得数据太多了,而且容易出错,于是就想到了用ajax嵌套的方法来解决,就想平时用ajax的方法直接嵌套,都会先读出外面ajax的内容,然后才读取嵌套在ajax里面的内容,后面经网上查找资料,加个async:false这个ajax参数就行了,下面是贴代码:

<script type="text/javascript">
$(function () {
$.ajax({
type: "get",
url: "/xmldata/provinces.xml",
datatype: "xml",
success: function (xml) {
$("body").append("{");
$(xml).find("provinces > province").each(function (i) {
$("body").append("{\"pid\":\"" + $(this).attr("id") + "\",\"provincename\": \"" + $(this).attr("provincename") + "\",\"citys\":[");
//根据省份,请求读取该省的市
getcitys($(this).attr("id"));
//第二个请求end
$("body").append("]},<br/>");
});
}
});
})
//第二次请求
function getcitys(pid) {
$.ajax({
type: "get",
url: "/xmldata/cities.xml",
datatype: "xml",
async: false,//注意!!这个为必要的参数,不然这个会在上面的ajax请求后才执行
success: function (xml) {
$(xml).find("cities > city[pid=" + pid + "]").each(function (i) {
$("body").append("{\"cityid\":\"" + $(this).attr("id") + "\",\"cityname\":\"" + $(this).attr("cityname") + "\"},");
});
}
});
}
</script>

记得在前面加上jq库,

下面把得到的全国省市的json数据贴出来,希望以后能用到:

{{\"provinceid\":\"1\",\"province\":\"北京市\",\"city\":[{\"cityid\":\"1\",\"cityname\":\"北京市\"}]},
{\"provinceid\":\"2\",\"province\":\"天津市\",\"city\":[{\"cityid\":\"2\",\"cityname\":\"天津市\"}]},
{\"provinceid\":\"3\",\"province\":\"河北省\",\"city\":[{\"cityid\":\"3\",\"cityname\":\"石家庄市\"},{\"cityid\":\"4\",\"cityname\":\"唐山市\"},{\"cityid\":\"5\",\"cityname\":\"秦皇岛市\"},{\"cityid\":\"6\",\"cityname\":\"邯郸市\"},{\"cityid\":\"7\",\"cityname\":\"邢台市\"},{\"cityid\":\"8\",\"cityname\":\"保定市\"},{\"cityid\":\"9\",\"cityname\":\"张家口市\"},{\"cityid\":\"10\",\"cityname\":\"承德市\"},{\"cityid\":\"11\",\"cityname\":\"沧州市\"},{\"cityid\":\"12\",\"cityname\":\"廊坊市\"},{\"cityid\":\"13\",\"cityname\":\"衡水市\"}]},
{\"provinceid\":\"4\",\"province\":\"山西省\",\"city\":[{\"cityid\":\"14\",\"cityname\":\"太原市\"},{\"cityid\":\"15\",\"cityname\":\"大同市\"},{\"cityid\":\"16\",\"cityname\":\"阳泉市\"},{\"cityid\":\"17\",\"cityname\":\"长治市\"},{\"cityid\":\"18\",\"cityname\":\"晋城市\"},{\"cityid\":\"19\",\"cityname\":\"朔州市\"},{\"cityid\":\"20\",\"cityname\":\"晋中市\"},{\"cityid\":\"21\",\"cityname\":\"运城市\"},{\"cityid\":\"22\",\"cityname\":\"忻州市\"},{\"cityid\":\"23\",\"cityname\":\"临汾市\"},{\"cityid\":\"24\",\"cityname\":\"吕梁市\"}]},
{\"provinceid\":\"5\",\"province\":\"内蒙古自治区\",\"city\":[{\"cityid\":\"25\",\"cityname\":\"呼和浩特市\"},{\"cityid\":\"26\",\"cityname\":\"包头市\"},{\"cityid\":\"27\",\"cityname\":\"乌海市\"},{\"cityid\":\"28\",\"cityname\":\"赤峰市\"},{\"cityid\":\"29\",\"cityname\":\"通辽市\"},{\"cityid\":\"30\",\"cityname\":\"鄂尔多斯市\"},{\"cityid\":\"31\",\"cityname\":\"呼伦贝尔市\"},{\"cityid\":\"32\",\"cityname\":\"巴彦淖尔市\"},{\"cityid\":\"33\",\"cityname\":\"乌兰察布市\"},{\"cityid\":\"34\",\"cityname\":\"兴安盟\"},{\"cityid\":\"35\",\"cityname\":\"锡林郭勒盟\"},{\"cityid\":\"36\",\"cityname\":\"阿拉善盟\"}]},
{\"provinceid\":\"6\",\"province\":\"辽宁省\",\"city\":[{\"cityid\":\"37\",\"cityname\":\"沈阳市\"},{\"cityid\":\"38\",\"cityname\":\"大连市\"},{\"cityid\":\"39\",\"cityname\":\"鞍山市\"},{\"cityid\":\"40\",\"cityname\":\"抚顺市\"},{\"cityid\":\"41\",\"cityname\":\"本溪市\"},{\"cityid\":\"42\",\"cityname\":\"丹东市\"},{\"cityid\":\"43\",\"cityname\":\"锦州市\"},{\"cityid\":\"44\",\"cityname\":\"营口市\"},{\"cityid\":\"45\",\"cityname\":\"阜新市\"},{\"cityid\":\"46\",\"cityname\":\"辽阳市\"},{\"cityid\":\"47\",\"cityname\":\"盘锦市\"},{\"cityid\":\"48\",\"cityname\":\"铁岭市\"},{\"cityid\":\"49\",\"cityname\":\"朝阳市\"},{\"cityid\":\"50\",\"cityname\":\"葫芦岛市\"}]},
{\"provinceid\":\"7\",\"province\":\"吉林省\",\"city\":[{\"cityid\":\"51\",\"cityname\":\"长春市\"},{\"cityid\":\"52\",\"cityname\":\"吉林市\"},{\"cityid\":\"53\",\"cityname\":\"四平市\"},{\"cityid\":\"54\",\"cityname\":\"辽源市\"},{\"cityid\":\"55\",\"cityname\":\"通化市\"},{\"cityid\":\"56\",\"cityname\":\"白山市\"},{\"cityid\":\"57\",\"cityname\":\"*市\"},{\"cityid\":\"58\",\"cityname\":\"白城市\"},{\"cityid\":\"59\",\"cityname\":\"延边朝鲜族自治州\"}]},
{\"provinceid\":\"8\",\"province\":\"黑龙江省\",\"city\":[{\"cityid\":\"60\",\"cityname\":\"哈尔滨市\"},{\"cityid\":\"61\",\"cityname\":\"齐齐哈尔市\"},{\"cityid\":\"62\",\"cityname\":\"鸡西市\"},{\"cityid\":\"63\",\"cityname\":\"鹤岗市\"},{\"cityid\":\"64\",\"cityname\":\"双鸭山市\"},{\"cityid\":\"65\",\"cityname\":\"大庆市\"},{\"cityid\":\"66\",\"cityname\":\"伊春市\"},{\"cityid\":\"67\",\"cityname\":\"佳木斯市\"},{\"cityid\":\"68\",\"cityname\":\"七台河市\"},{\"cityid\":\"69\",\"cityname\":\"牡丹江市\"},{\"cityid\":\"70\",\"cityname\":\"黑河市\"},{\"cityid\":\"71\",\"cityname\":\"绥化市\"},{\"cityid\":\"72\",\"cityname\":\"大兴安岭地区\"}]},
{\"provinceid\":\"9\",\"province\":\"上海市\",\"city\":[{\"cityid\":\"73\",\"cityname\":\"上海市\"}]},
{\"provinceid\":\"10\",\"province\":\"江苏省\",\"city\":[{\"cityid\":\"74\",\"cityname\":\"南京市\"},{\"cityid\":\"75\",\"cityname\":\"无锡市\"},{\"cityid\":\"76\",\"cityname\":\"徐州市\"},{\"cityid\":\"77\",\"cityname\":\"常州市\"},{\"cityid\":\"78\",\"cityname\":\"苏州市\"},{\"cityid\":\"79\",\"cityname\":\"南通市\"},{\"cityid\":\"80\",\"cityname\":\"连云港市\"},{\"cityid\":\"81\",\"cityname\":\"淮安市\"},{\"cityid\":\"82\",\"cityname\":\"盐城市\"},{\"cityid\":\"83\",\"cityname\":\"扬州市\"},{\"cityid\":\"84\",\"cityname\":\"镇江市\"},{\"cityid\":\"85\",\"cityname\":\"泰州市\"},{\"cityid\":\"86\",\"cityname\":\"宿迁市\"}]},
{\"provinceid\":\"11\",\"province\":\"浙江省\",\"city\":[{\"cityid\":\"87\",\"cityname\":\"杭州市\"},{\"cityid\":\"88\",\"cityname\":\"宁波市\"},{\"cityid\":\"89\",\"cityname\":\"温州市\"},{\"cityid\":\"90\",\"cityname\":\"嘉兴市\"},{\"cityid\":\"91\",\"cityname\":\"湖州市\"},{\"cityid\":\"92\",\"cityname\":\"绍兴市\"},{\"cityid\":\"93\",\"cityname\":\"金华市\"},{\"cityid\":\"94\",\"cityname\":\"衢州市\"},{\"cityid\":\"95\",\"cityname\":\"舟山市\"},{\"cityid\":\"96\",\"cityname\":\"台州市\"},{\"cityid\":\"97\",\"cityname\":\"丽水市\"}]},
{\"provinceid\":\"12\",\"province\":\"安徽省\",\"city\":[{\"cityid\":\"98\",\"cityname\":\"合肥市\"},{\"cityid\":\"99\",\"cityname\":\"芜湖市\"},{\"cityid\":\"100\",\"cityname\":\"蚌埠市\"},{\"cityid\":\"101\",\"cityname\":\"淮南市\"},{\"cityid\":\"102\",\"cityname\":\"马鞍山市\"},{\"cityid\":\"103\",\"cityname\":\"淮北市\"},{\"cityid\":\"104\",\"cityname\":\"铜陵市\"},{\"cityid\":\"105\",\"cityname\":\"安庆市\"},{\"cityid\":\"106\",\"cityname\":\"黄山市\"},{\"cityid\":\"107\",\"cityname\":\"滁州市\"},{\"cityid\":\"108\",\"cityname\":\"阜阳市\"},{\"cityid\":\"109\",\"cityname\":\"宿州市\"},{\"cityid\":\"110\",\"cityname\":\"巢湖市\"},{\"cityid\":\"111\",\"cityname\":\"六安市\"},{\"cityid\":\"112\",\"cityname\":\"亳州市\"},{\"cityid\":\"113\",\"cityname\":\"池州市\"},{\"cityid\":\"114\",\"cityname\":\"宣城市\"}]},
{\"provinceid\":\"13\",\"province\":\"福建省\",\"city\":[{\"cityid\":\"115\",\"cityname\":\"福州市\"},{\"cityid\":\"116\",\"cityname\":\"厦门市\"},{\"cityid\":\"117\",\"cityname\":\"莆田市\"},{\"cityid\":\"118\",\"cityname\":\"三明市\"},{\"cityid\":\"119\",\"cityname\":\"泉州市\"},{\"cityid\":\"120\",\"cityname\":\"漳州市\"},{\"cityid\":\"121\",\"cityname\":\"南平市\"},{\"cityid\":\"122\",\"cityname\":\"龙岩市\"},{\"cityid\":\"123\",\"cityname\":\"宁德市\"}]},
{\"provinceid\":\"14\",\"province\":\"江西省\",\"city\":[{\"cityid\":\"124\",\"cityname\":\"南昌市\"},{\"cityid\":\"125\",\"cityname\":\"景德镇市\"},{\"cityid\":\"126\",\"cityname\":\"萍乡市\"},{\"cityid\":\"127\",\"cityname\":\"九江市\"},{\"cityid\":\"128\",\"cityname\":\"新余市\"},{\"cityid\":\"129\",\"cityname\":\"鹰潭市\"},{\"cityid\":\"130\",\"cityname\":\"赣州市\"},{\"cityid\":\"131\",\"cityname\":\"吉安市\"},{\"cityid\":\"132\",\"cityname\":\"宜春市\"},{\"cityid\":\"133\",\"cityname\":\"抚州市\"},{\"cityid\":\"134\",\"cityname\":\"上饶市\"}]},
{\"provinceid\":\"15\",\"province\":\"山东省\",\"city\":[{\"cityid\":\"135\",\"cityname\":\"济南市\"},{\"cityid\":\"136\",\"cityname\":\"青岛市\"},{\"cityid\":\"137\",\"cityname\":\"淄博市\"},{\"cityid\":\"138\",\"cityname\":\"枣庄市\"},{\"cityid\":\"139\",\"cityname\":\"东营市\"},{\"cityid\":\"140\",\"cityname\":\"烟台市\"},{\"cityid\":\"141\",\"cityname\":\"潍坊市\"},{\"cityid\":\"142\",\"cityname\":\"济宁市\"},{\"cityid\":\"143\",\"cityname\":\"泰安市\"},{\"cityid\":\"144\",\"cityname\":\"威海市\"},{\"cityid\":\"145\",\"cityname\":\"日照市\"},{\"cityid\":\"146\",\"cityname\":\"莱芜市\"},{\"cityid\":\"147\",\"cityname\":\"临沂市\"},{\"cityid\":\"148\",\"cityname\":\"德州市\"},{\"cityid\":\"149\",\"cityname\":\"聊城市\"},{\"cityid\":\"150\",\"cityname\":\"滨州市\"},{\"cityid\":\"151\",\"cityname\":\"荷泽市\"}]},
{\"provinceid\":\"16\",\"province\":\"河南省\",\"city\":[{\"cityid\":\"152\",\"cityname\":\"郑州市\"},{\"cityid\":\"153\",\"cityname\":\"开封市\"},{\"cityid\":\"154\",\"cityname\":\"洛阳市\"},{\"cityid\":\"155\",\"cityname\":\"平顶山市\"},{\"cityid\":\"156\",\"cityname\":\"安阳市\"},{\"cityid\":\"157\",\"cityname\":\"鹤壁市\"},{\"cityid\":\"158\",\"cityname\":\"新乡市\"},{\"cityid\":\"159\",\"cityname\":\"焦作市\"},{\"cityid\":\"160\",\"cityname\":\"濮阳市\"},{\"cityid\":\"161\",\"cityname\":\"许昌市\"},{\"cityid\":\"162\",\"cityname\":\"漯河市\"},{\"cityid\":\"163\",\"cityname\":\"三门峡市\"},{\"cityid\":\"164\",\"cityname\":\"南阳市\"},{\"cityid\":\"165\",\"cityname\":\"商丘市\"},{\"cityid\":\"166\",\"cityname\":\"信阳市\"},{\"cityid\":\"167\",\"cityname\":\"周口市\"},{\"cityid\":\"168\",\"cityname\":\"驻马店市\"}]},
{\"provinceid\":\"17\",\"province\":\"湖北省\",\"city\":[{\"cityid\":\"169\",\"cityname\":\"武汉市\"},{\"cityid\":\"170\",\"cityname\":\"黄石市\"},{\"cityid\":\"171\",\"cityname\":\"十堰市\"},{\"cityid\":\"172\",\"cityname\":\"宜昌市\"},{\"cityid\":\"173\",\"cityname\":\"襄樊市\"},{\"cityid\":\"174\",\"cityname\":\"鄂州市\"},{\"cityid\":\"175\",\"cityname\":\"荆门市\"},{\"cityid\":\"176\",\"cityname\":\"孝感市\"},{\"cityid\":\"177\",\"cityname\":\"荆州市\"},{\"cityid\":\"178\",\"cityname\":\"黄冈市\"},{\"cityid\":\"179\",\"cityname\":\"咸宁市\"},{\"cityid\":\"180\",\"cityname\":\"随州市\"},{\"cityid\":\"181\",\"cityname\":\"恩施土家族苗族自治州\"},{\"cityid\":\"182\",\"cityname\":\"神农架\"}]},
{\"provinceid\":\"18\",\"province\":\"湖南省\",\"city\":[{\"cityid\":\"183\",\"cityname\":\"长沙市\"},{\"cityid\":\"184\",\"cityname\":\"株洲市\"},{\"cityid\":\"185\",\"cityname\":\"湘潭市\"},{\"cityid\":\"186\",\"cityname\":\"衡阳市\"},{\"cityid\":\"187\",\"cityname\":\"邵阳市\"},{\"cityid\":\"188\",\"cityname\":\"岳阳市\"},{\"cityid\":\"189\",\"cityname\":\"常德市\"},{\"cityid\":\"190\",\"cityname\":\"张家界市\"},{\"cityid\":\"191\",\"cityname\":\"益阳市\"},{\"cityid\":\"192\",\"cityname\":\"郴州市\"},{\"cityid\":\"193\",\"cityname\":\"永州市\"},{\"cityid\":\"194\",\"cityname\":\"怀化市\"},{\"cityid\":\"195\",\"cityname\":\"娄底市\"},{\"cityid\":\"196\",\"cityname\":\"湘西土家族苗族自治州\"}]},
{\"provinceid\":\"19\",\"province\":\"广东省\",\"city\":[{\"cityid\":\"197\",\"cityname\":\"广州市\"},{\"cityid\":\"198\",\"cityname\":\"韶关市\"},{\"cityid\":\"199\",\"cityname\":\"深圳市\"},{\"cityid\":\"200\",\"cityname\":\"珠海市\"},{\"cityid\":\"201\",\"cityname\":\"汕头市\"},{\"cityid\":\"202\",\"cityname\":\"佛山市\"},{\"cityid\":\"203\",\"cityname\":\"江门市\"},{\"cityid\":\"204\",\"cityname\":\"湛江市\"},{\"cityid\":\"205\",\"cityname\":\"茂名市\"},{\"cityid\":\"206\",\"cityname\":\"肇庆市\"},{\"cityid\":\"207\",\"cityname\":\"惠州市\"},{\"cityid\":\"208\",\"cityname\":\"梅州市\"},{\"cityid\":\"209\",\"cityname\":\"汕尾市\"},{\"cityid\":\"210\",\"cityname\":\"河源市\"},{\"cityid\":\"211\",\"cityname\":\"阳江市\"},{\"cityid\":\"212\",\"cityname\":\"清远市\"},{\"cityid\":\"213\",\"cityname\":\"东莞市\"},{\"cityid\":\"214\",\"cityname\":\"中山市\"},{\"cityid\":\"215\",\"cityname\":\"潮州市\"},{\"cityid\":\"216\",\"cityname\":\"揭阳市\"},{\"cityid\":\"217\",\"cityname\":\"云浮市\"}]},
{\"provinceid\":\"20\",\"province\":\"广西壮族自治区\",\"city\":[{\"cityid\":\"218\",\"cityname\":\"南宁市\"},{\"cityid\":\"219\",\"cityname\":\"柳州市\"},{\"cityid\":\"220\",\"cityname\":\"桂林市\"},{\"cityid\":\"221\",\"cityname\":\"梧州市\"},{\"cityid\":\"222\",\"cityname\":\"北海市\"},{\"cityid\":\"223\",\"cityname\":\"防城港市\"},{\"cityid\":\"224\",\"cityname\":\"钦州市\"},{\"cityid\":\"225\",\"cityname\":\"贵港市\"},{\"cityid\":\"226\",\"cityname\":\"玉林市\"},{\"cityid\":\"227\",\"cityname\":\"百色市\"},{\"cityid\":\"228\",\"cityname\":\"贺州市\"},{\"cityid\":\"229\",\"cityname\":\"河池市\"},{\"cityid\":\"230\",\"cityname\":\"来宾市\"},{\"cityid\":\"231\",\"cityname\":\"崇左市\"}]},
{\"provinceid\":\"21\",\"province\":\"海南省\",\"city\":[{\"cityid\":\"232\",\"cityname\":\"海口市\"},{\"cityid\":\"233\",\"cityname\":\"三亚市\"}]},
{\"provinceid\":\"22\",\"province\":\"重庆市\",\"city\":[{\"cityid\":\"234\",\"cityname\":\"重庆市\"}]},
{\"provinceid\":\"23\",\"province\":\"四川省\",\"city\":[{\"cityid\":\"235\",\"cityname\":\"成都市\"},{\"cityid\":\"236\",\"cityname\":\"自贡市\"},{\"cityid\":\"237\",\"cityname\":\"攀枝花市\"},{\"cityid\":\"238\",\"cityname\":\"泸州市\"},{\"cityid\":\"239\",\"cityname\":\"德阳市\"},{\"cityid\":\"240\",\"cityname\":\"绵阳市\"},{\"cityid\":\"241\",\"cityname\":\"广元市\"},{\"cityid\":\"242\",\"cityname\":\"遂宁市\"},{\"cityid\":\"243\",\"cityname\":\"内江市\"},{\"cityid\":\"244\",\"cityname\":\"乐山市\"},{\"cityid\":\"245\",\"cityname\":\"南充市\"},{\"cityid\":\"246\",\"cityname\":\"眉山市\"},{\"cityid\":\"247\",\"cityname\":\"宜宾市\"},{\"cityid\":\"248\",\"cityname\":\"广安市\"},{\"cityid\":\"249\",\"cityname\":\"达州市\"},{\"cityid\":\"250\",\"cityname\":\"雅安市\"},{\"cityid\":\"251\",\"cityname\":\"巴中市\"},{\"cityid\":\"252\",\"cityname\":\"资阳市\"},{\"cityid\":\"253\",\"cityname\":\"阿坝藏族羌族自治州\"},{\"cityid\":\"254\",\"cityname\":\"甘孜藏族自治州\"},{\"cityid\":\"255\",\"cityname\":\"凉山彝族自治州\"}]},
{\"provinceid\":\"24\",\"province\":\"贵州省\",\"city\":[{\"cityid\":\"256\",\"cityname\":\"贵阳市\"},{\"cityid\":\"257\",\"cityname\":\"六盘水市\"},{\"cityid\":\"258\",\"cityname\":\"遵义市\"},{\"cityid\":\"259\",\"cityname\":\"安顺市\"},{\"cityid\":\"260\",\"cityname\":\"铜仁地区\"},{\"cityid\":\"261\",\"cityname\":\"黔西南布依族苗族自治州\"},{\"cityid\":\"262\",\"cityname\":\"毕节地区\"},{\"cityid\":\"263\",\"cityname\":\"黔东南苗族侗族自治州\"},{\"cityid\":\"264\",\"cityname\":\"黔南布依族苗族自治州\"}]},
{\"provinceid\":\"25\",\"province\":\"云南省\",\"city\":[{\"cityid\":\"265\",\"cityname\":\"昆明市\"},{\"cityid\":\"266\",\"cityname\":\"曲靖市\"},{\"cityid\":\"267\",\"cityname\":\"玉溪市\"},{\"cityid\":\"268\",\"cityname\":\"保山市\"},{\"cityid\":\"269\",\"cityname\":\"昭通市\"},{\"cityid\":\"270\",\"cityname\":\"丽江市\"},{\"cityid\":\"271\",\"cityname\":\"思茅市\"},{\"cityid\":\"272\",\"cityname\":\"临沧市\"},{\"cityid\":\"273\",\"cityname\":\"楚雄彝族自治州\"},{\"cityid\":\"274\",\"cityname\":\"红河哈尼族彝族自治州\"},{\"cityid\":\"275\",\"cityname\":\"文山壮族苗族自治州\"},{\"cityid\":\"276\",\"cityname\":\"西双版纳傣族自治州\"},{\"cityid\":\"277\",\"cityname\":\"大理白族自治州\"},{\"cityid\":\"278\",\"cityname\":\"德宏傣族景颇族自治州\"},{\"cityid\":\"279\",\"cityname\":\"怒江傈僳族自治州\"},{\"cityid\":\"280\",\"cityname\":\"迪庆藏族自治州\"}]},
{\"provinceid\":\"26\",\"province\":\"*自治区\",\"city\":[{\"cityid\":\"281\",\"cityname\":\"拉萨市\"},{\"cityid\":\"282\",\"cityname\":\"昌都地区\"},{\"cityid\":\"283\",\"cityname\":\"山南地区\"},{\"cityid\":\"284\",\"cityname\":\"日喀则地区\"},{\"cityid\":\"285\",\"cityname\":\"那曲地区\"},{\"cityid\":\"286\",\"cityname\":\"阿里地区\"},{\"cityid\":\"287\",\"cityname\":\"林芝地区\"}]},
{\"provinceid\":\"27\",\"province\":\"陕西省\",\"city\":[{\"cityid\":\"288\",\"cityname\":\"西安市\"},{\"cityid\":\"289\",\"cityname\":\"铜川市\"},{\"cityid\":\"290\",\"cityname\":\"宝鸡市\"},{\"cityid\":\"291\",\"cityname\":\"咸阳市\"},{\"cityid\":\"292\",\"cityname\":\"渭南市\"},{\"cityid\":\"293\",\"cityname\":\"延安市\"},{\"cityid\":\"294\",\"cityname\":\"汉中市\"},{\"cityid\":\"295\",\"cityname\":\"榆林市\"},{\"cityid\":\"296\",\"cityname\":\"安康市\"},{\"cityid\":\"297\",\"cityname\":\"商洛市\"}]},
{\"provinceid\":\"28\",\"province\":\"甘肃省\",\"city\":[{\"cityid\":\"298\",\"cityname\":\"兰州市\"},{\"cityid\":\"299\",\"cityname\":\"嘉峪关市\"},{\"cityid\":\"300\",\"cityname\":\"金昌市\"},{\"cityid\":\"301\",\"cityname\":\"白银市\"},{\"cityid\":\"302\",\"cityname\":\"天水市\"},{\"cityid\":\"303\",\"cityname\":\"武威市\"},{\"cityid\":\"304\",\"cityname\":\"张掖市\"},{\"cityid\":\"305\",\"cityname\":\"平凉市\"},{\"cityid\":\"306\",\"cityname\":\"酒泉市\"},{\"cityid\":\"307\",\"cityname\":\"庆阳市\"},{\"cityid\":\"308\",\"cityname\":\"定西市\"},{\"cityid\":\"309\",\"cityname\":\"陇南市\"},{\"cityid\":\"310\",\"cityname\":\"临夏回族自治州\"},{\"cityid\":\"311\",\"cityname\":\"甘南藏族自治州\"}]},
{\"provinceid\":\"29\",\"province\":\"青海省\",\"city\":[{\"cityid\":\"312\",\"cityname\":\"西宁市\"},{\"cityid\":\"313\",\"cityname\":\"海东地区\"},{\"cityid\":\"314\",\"cityname\":\"海北藏族自治州\"},{\"cityid\":\"315\",\"cityname\":\"黄南藏族自治州\"},{\"cityid\":\"316\",\"cityname\":\"海南藏族自治州\"},{\"cityid\":\"317\",\"cityname\":\"果洛藏族自治州\"},{\"cityid\":\"318\",\"cityname\":\"玉树藏族自治州\"},{\"cityid\":\"319\",\"cityname\":\"海西蒙古族藏族自治州\"}]},
{\"provinceid\":\"30\",\"province\":\"宁夏回族自治区\",\"city\":[{\"cityid\":\"320\",\"cityname\":\"银川市\"},{\"cityid\":\"321\",\"cityname\":\"石嘴山市\"},{\"cityid\":\"322\",\"cityname\":\"吴忠市\"},{\"cityid\":\"323\",\"cityname\":\"固原市\"},{\"cityid\":\"324\",\"cityname\":\"中卫市\"}]},
{\"provinceid\":\"31\",\"province\":\"**自治区\",\"city\":[{\"cityid\":\"325\",\"cityname\":\"乌鲁木齐市\"},{\"cityid\":\"326\",\"cityname\":\"克拉玛依市\"},{\"cityid\":\"327\",\"cityname\":\"吐鲁番地区\"},{\"cityid\":\"328\",\"cityname\":\"哈密地区\"},{\"cityid\":\"329\",\"cityname\":\"昌吉回族自治州\"},{\"cityid\":\"330\",\"cityname\":\"博尔塔拉蒙古自治州\"},{\"cityid\":\"331\",\"cityname\":\"巴音郭楞蒙古自治州\"},{\"cityid\":\"332\",\"cityname\":\"阿克苏地区\"},{\"cityid\":\"333\",\"cityname\":\"克孜勒苏柯尔克孜自治州\"},{\"cityid\":\"334\",\"cityname\":\"喀什地区\"},{\"cityid\":\"335\",\"cityname\":\"和田地区\"},{\"cityid\":\"336\",\"cityname\":\"伊犁哈萨克自治州\"},{\"cityid\":\"337\",\"cityname\":\"塔城地区\"},{\"cityid\":\"338\",\"cityname\":\"阿勒泰地区\"},{\"cityid\":\"339\",\"cityname\":\"石河子市\"},{\"cityid\":\"340\",\"cityname\":\"阿拉尔市\"},{\"cityid\":\"341\",\"cityname\":\"图木舒克市\"},{\"cityid\":\"342\",\"cityname\":\"五家渠市\"}]},
{\"provinceid\":\"32\",\"province\":\"香港特别行政区\",\"city\":[{\"cityid\":\"343\",\"cityname\":\"香港特别行政区\"}]},
{\"provinceid\":\"33\",\"province\":\"澳门特别行政区\",\"city\":[{\"cityid\":\"344\",\"cityname\":\"澳门特别行政区\"}]},
{\"provinceid\":\"34\",\"province\":\"*省\",\"city\":[{\"cityid\":\"345\",\"cityname\":\"*省\"}]}}