主頁 > 知識庫 > Ajax請求內(nèi)嵌套Ajax請求示例代碼

Ajax請求內(nèi)嵌套Ajax請求示例代碼

熱門標(biāo)簽:徐州電銷卡外呼系統(tǒng)供應(yīng)商 老虎郵局地圖標(biāo)注點(diǎn) 目標(biāo)三維地圖標(biāo)注 百靈鳥 上海浦東百度地圖標(biāo)注中心注冊 襄陽外呼系統(tǒng)接口 外呼系統(tǒng)獲取客戶手機(jī)號 青海醫(yī)療智能外呼系統(tǒng)怎么樣 科智聯(lián)智能電銷機(jī)器人

前段時(shí)間做項(xiàng)目,需要把全國省市的兩個XML文件整合成一個JSON格式的數(shù)據(jù),手寫的話覺得數(shù)據(jù)太多了,而且容易出錯,于是就想到了用Ajax嵌套的方法來解決,就想平時(shí)用Ajax的方法直接嵌套,都會先讀出外面Ajax的內(nèi)容,然后才讀取嵌套在Ajax里面的內(nèi)容,后面經(jīng)網(wǎng)上查找資料,加個async:false這個Ajax參數(shù)就行了,下面是貼代碼:

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\":[");
//根據(jù)省份,請求讀取該省的市
GetCitys($(this).attr("ID"));
//第二個請求end
$("body").append("]},br/>");
});
}
});
})
//第二次請求
function GetCitys(pid) {
$.ajax({
type: "get",
url: "/XmlData/Cities.xml",
datatype: "xml",
async: false,//注意??!這個為必要的參數(shù),不然這個會在上面的Ajax請求后才執(zhí)行
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數(shù)據(jù)貼出來,希望以后能用到:

{{\"ProvinceID\":\"1\",\"Province\":\"北京市\(zhòng)",\"City\":[{\"CityID\":\"1\",\"CityName\":\"北京市\(zhòng)"}]},
{\"ProvinceID\":\"2\",\"Province\":\"天津市\(zhòng)",\"City\":[{\"CityID\":\"2\",\"CityName\":\"天津市\(zhòng)"}]},
{\"ProvinceID\":\"3\",\"Province\":\"河北省\",\"City\":[{\"CityID\":\"3\",\"CityName\":\"石家莊市\(zhòng)"},{\"CityID\":\"4\",\"CityName\":\"唐山市\(zhòng)"},{\"CityID\":\"5\",\"CityName\":\"秦皇島市\(zhòng)"},{\"CityID\":\"6\",\"CityName\":\"邯鄲市\(zhòng)"},{\"CityID\":\"7\",\"CityName\":\"邢臺市\(zhòng)"},{\"CityID\":\"8\",\"CityName\":\"保定市\(zhòng)"},{\"CityID\":\"9\",\"CityName\":\"張家口市\(zhòng)"},{\"CityID\":\"10\",\"CityName\":\"承德市\(zhòng)"},{\"CityID\":\"11\",\"CityName\":\"滄州市\(zhòng)"},{\"CityID\":\"12\",\"CityName\":\"廊坊市\(zhòng)"},{\"CityID\":\"13\",\"CityName\":\"衡水市\(zhòng)"}]},
{\"ProvinceID\":\"4\",\"Province\":\"山西省\",\"City\":[{\"CityID\":\"14\",\"CityName\":\"太原市\(zhòng)"},{\"CityID\":\"15\",\"CityName\":\"大同市\(zhòng)"},{\"CityID\":\"16\",\"CityName\":\"陽泉市\(zhòng)"},{\"CityID\":\"17\",\"CityName\":\"長治市\(zhòng)"},{\"CityID\":\"18\",\"CityName\":\"晉城市\(zhòng)"},{\"CityID\":\"19\",\"CityName\":\"朔州市\(zhòng)"},{\"CityID\":\"20\",\"CityName\":\"晉中市\(zhòng)"},{\"CityID\":\"21\",\"CityName\":\"運(yùn)城市\(zhòng)"},{\"CityID\":\"22\",\"CityName\":\"忻州市\(zhòng)"},{\"CityID\":\"23\",\"CityName\":\"臨汾市\(zhòng)"},{\"CityID\":\"24\",\"CityName\":\"呂梁市\(zhòng)"}]},
{\"ProvinceID\":\"5\",\"Province\":\"內(nèi)蒙古自治區(qū)\",\"City\":[{\"CityID\":\"25\",\"CityName\":\"呼和浩特市\(zhòng)"},{\"CityID\":\"26\",\"CityName\":\"包頭市\(zhòng)"},{\"CityID\":\"27\",\"CityName\":\"烏海市\(zhòng)"},{\"CityID\":\"28\",\"CityName\":\"赤峰市\(zhòng)"},{\"CityID\":\"29\",\"CityName\":\"通遼市\(zhòng)"},{\"CityID\":\"30\",\"CityName\":\"鄂爾多斯市\(zhòng)"},{\"CityID\":\"31\",\"CityName\":\"呼倫貝爾市\(zhòng)"},{\"CityID\":\"32\",\"CityName\":\"巴彥淖爾市\(zhòng)"},{\"CityID\":\"33\",\"CityName\":\"烏蘭察布市\(zhòng)"},{\"CityID\":\"34\",\"CityName\":\"興安盟\"},{\"CityID\":\"35\",\"CityName\":\"錫林郭勒盟\"},{\"CityID\":\"36\",\"CityName\":\"阿拉善盟\"}]},
{\"ProvinceID\":\"6\",\"Province\":\"遼寧省\",\"City\":[{\"CityID\":\"37\",\"CityName\":\"沈陽市\(zhòng)"},{\"CityID\":\"38\",\"CityName\":\"大連市\(zhòng)"},{\"CityID\":\"39\",\"CityName\":\"鞍山市\(zhòng)"},{\"CityID\":\"40\",\"CityName\":\"撫順市\(zhòng)"},{\"CityID\":\"41\",\"CityName\":\"本溪市\(zhòng)"},{\"CityID\":\"42\",\"CityName\":\"丹東市\(zhòng)"},{\"CityID\":\"43\",\"CityName\":\"錦州市\(zhòng)"},{\"CityID\":\"44\",\"CityName\":\"營口市\(zhòng)"},{\"CityID\":\"45\",\"CityName\":\"阜新市\(zhòng)"},{\"CityID\":\"46\",\"CityName\":\"遼陽市\(zhòng)"},{\"CityID\":\"47\",\"CityName\":\"盤錦市\(zhòng)"},{\"CityID\":\"48\",\"CityName\":\"鐵嶺市\(zhòng)"},{\"CityID\":\"49\",\"CityName\":\"朝陽市\(zhòng)"},{\"CityID\":\"50\",\"CityName\":\"葫蘆島市\(zhòng)"}]},
{\"ProvinceID\":\"7\",\"Province\":\"吉林省\",\"City\":[{\"CityID\":\"51\",\"CityName\":\"長春市\(zhòng)"},{\"CityID\":\"52\",\"CityName\":\"吉林市\(zhòng)"},{\"CityID\":\"53\",\"CityName\":\"四平市\(zhòng)"},{\"CityID\":\"54\",\"CityName\":\"遼源市\(zhòng)"},{\"CityID\":\"55\",\"CityName\":\"通化市\(zhòng)"},{\"CityID\":\"56\",\"CityName\":\"白山市\(zhòng)"},{\"CityID\":\"57\",\"CityName\":\"松原市\(zhòng)"},{\"CityID\":\"58\",\"CityName\":\"白城市\(zhòng)"},{\"CityID\":\"59\",\"CityName\":\"延邊朝鮮族自治州\"}]},
{\"ProvinceID\":\"8\",\"Province\":\"黑龍江省\",\"City\":[{\"CityID\":\"60\",\"CityName\":\"哈爾濱市\(zhòng)"},{\"CityID\":\"61\",\"CityName\":\"齊齊哈爾市\(zhòng)"},{\"CityID\":\"62\",\"CityName\":\"雞西市\(zhòng)"},{\"CityID\":\"63\",\"CityName\":\"鶴崗市\(zhòng)"},{\"CityID\":\"64\",\"CityName\":\"雙鴨山市\(zhòng)"},{\"CityID\":\"65\",\"CityName\":\"大慶市\(zhòng)"},{\"CityID\":\"66\",\"CityName\":\"伊春市\(zhòng)"},{\"CityID\":\"67\",\"CityName\":\"佳木斯市\(zhòng)"},{\"CityID\":\"68\",\"CityName\":\"七臺河市\(zhòng)"},{\"CityID\":\"69\",\"CityName\":\"牡丹江市\(zhòng)"},{\"CityID\":\"70\",\"CityName\":\"黑河市\(zhòng)"},{\"CityID\":\"71\",\"CityName\":\"綏化市\(zhòng)"},{\"CityID\":\"72\",\"CityName\":\"大興安嶺地區(qū)\"}]},
{\"ProvinceID\":\"9\",\"Province\":\"上海市\(zhòng)",\"City\":[{\"CityID\":\"73\",\"CityName\":\"上海市\(zhòng)"}]},
{\"ProvinceID\":\"10\",\"Province\":\"江蘇省\",\"City\":[{\"CityID\":\"74\",\"CityName\":\"南京市\(zhòng)"},{\"CityID\":\"75\",\"CityName\":\"無錫市\(zhòng)"},{\"CityID\":\"76\",\"CityName\":\"徐州市\(zhòng)"},{\"CityID\":\"77\",\"CityName\":\"常州市\(zhòng)"},{\"CityID\":\"78\",\"CityName\":\"蘇州市\(zhòng)"},{\"CityID\":\"79\",\"CityName\":\"南通市\(zhòng)"},{\"CityID\":\"80\",\"CityName\":\"連云港市\(zhòng)"},{\"CityID\":\"81\",\"CityName\":\"淮安市\(zhòng)"},{\"CityID\":\"82\",\"CityName\":\"鹽城市\(zhòng)"},{\"CityID\":\"83\",\"CityName\":\"揚(yáng)州市\(zhòng)"},{\"CityID\":\"84\",\"CityName\":\"鎮(zhèn)江市\(zhòng)"},{\"CityID\":\"85\",\"CityName\":\"泰州市\(zhòng)"},{\"CityID\":\"86\",\"CityName\":\"宿遷市\(zhòng)"}]},
{\"ProvinceID\":\"11\",\"Province\":\"浙江省\",\"City\":[{\"CityID\":\"87\",\"CityName\":\"杭州市\(zhòng)"},{\"CityID\":\"88\",\"CityName\":\"寧波市\(zhòng)"},{\"CityID\":\"89\",\"CityName\":\"溫州市\(zhòng)"},{\"CityID\":\"90\",\"CityName\":\"嘉興市\(zhòng)"},{\"CityID\":\"91\",\"CityName\":\"湖州市\(zhòng)"},{\"CityID\":\"92\",\"CityName\":\"紹興市\(zhòng)"},{\"CityID\":\"93\",\"CityName\":\"金華市\(zhòng)"},{\"CityID\":\"94\",\"CityName\":\"衢州市\(zhòng)"},{\"CityID\":\"95\",\"CityName\":\"舟山市\(zhòng)"},{\"CityID\":\"96\",\"CityName\":\"臺州市\(zhòng)"},{\"CityID\":\"97\",\"CityName\":\"麗水市\(zhòng)"}]},
{\"ProvinceID\":\"12\",\"Province\":\"安徽省\",\"City\":[{\"CityID\":\"98\",\"CityName\":\"合肥市\(zhòng)"},{\"CityID\":\"99\",\"CityName\":\"蕪湖市\(zhòng)"},{\"CityID\":\"100\",\"CityName\":\"蚌埠市\(zhòng)"},{\"CityID\":\"101\",\"CityName\":\"淮南市\(zhòng)"},{\"CityID\":\"102\",\"CityName\":\"馬鞍山市\(zhòng)"},{\"CityID\":\"103\",\"CityName\":\"淮北市\(zhòng)"},{\"CityID\":\"104\",\"CityName\":\"銅陵市\(zhòng)"},{\"CityID\":\"105\",\"CityName\":\"安慶市\(zhòng)"},{\"CityID\":\"106\",\"CityName\":\"黃山市\(zhòng)"},{\"CityID\":\"107\",\"CityName\":\"滁州市\(zhòng)"},{\"CityID\":\"108\",\"CityName\":\"阜陽市\(zhòng)"},{\"CityID\":\"109\",\"CityName\":\"宿州市\(zhòng)"},{\"CityID\":\"110\",\"CityName\":\"巢湖市\(zhòng)"},{\"CityID\":\"111\",\"CityName\":\"六安市\(zhòng)"},{\"CityID\":\"112\",\"CityName\":\"亳州市\(zhòng)"},{\"CityID\":\"113\",\"CityName\":\"池州市\(zhòng)"},{\"CityID\":\"114\",\"CityName\":\"宣城市\(zhòng)"}]},
{\"ProvinceID\":\"13\",\"Province\":\"福建省\",\"City\":[{\"CityID\":\"115\",\"CityName\":\"福州市\(zhòng)"},{\"CityID\":\"116\",\"CityName\":\"廈門市\(zhòng)"},{\"CityID\":\"117\",\"CityName\":\"莆田市\(zhòng)"},{\"CityID\":\"118\",\"CityName\":\"三明市\(zhòng)"},{\"CityID\":\"119\",\"CityName\":\"泉州市\(zhòng)"},{\"CityID\":\"120\",\"CityName\":\"漳州市\(zhòng)"},{\"CityID\":\"121\",\"CityName\":\"南平市\(zhòng)"},{\"CityID\":\"122\",\"CityName\":\"龍巖市\(zhòng)"},{\"CityID\":\"123\",\"CityName\":\"寧德市\(zhòng)"}]},
{\"ProvinceID\":\"14\",\"Province\":\"江西省\",\"City\":[{\"CityID\":\"124\",\"CityName\":\"南昌市\(zhòng)"},{\"CityID\":\"125\",\"CityName\":\"景德鎮(zhèn)市\(zhòng)"},{\"CityID\":\"126\",\"CityName\":\"萍鄉(xiāng)市\(zhòng)"},{\"CityID\":\"127\",\"CityName\":\"九江市\(zhòng)"},{\"CityID\":\"128\",\"CityName\":\"新余市\(zhòng)"},{\"CityID\":\"129\",\"CityName\":\"鷹潭市\(zhòng)"},{\"CityID\":\"130\",\"CityName\":\"贛州市\(zhòng)"},{\"CityID\":\"131\",\"CityName\":\"吉安市\(zhòng)"},{\"CityID\":\"132\",\"CityName\":\"宜春市\(zhòng)"},{\"CityID\":\"133\",\"CityName\":\"撫州市\(zhòng)"},{\"CityID\":\"134\",\"CityName\":\"上饒市\(zhòng)"}]},
{\"ProvinceID\":\"15\",\"Province\":\"山東省\",\"City\":[{\"CityID\":\"135\",\"CityName\":\"濟(jì)南市\(zhòng)"},{\"CityID\":\"136\",\"CityName\":\"青島市\(zhòng)"},{\"CityID\":\"137\",\"CityName\":\"淄博市\(zhòng)"},{\"CityID\":\"138\",\"CityName\":\"棗莊市\(zhòng)"},{\"CityID\":\"139\",\"CityName\":\"東營市\(zhòng)"},{\"CityID\":\"140\",\"CityName\":\"煙臺市\(zhòng)"},{\"CityID\":\"141\",\"CityName\":\"濰坊市\(zhòng)"},{\"CityID\":\"142\",\"CityName\":\"濟(jì)寧市\(zhòng)"},{\"CityID\":\"143\",\"CityName\":\"泰安市\(zhòng)"},{\"CityID\":\"144\",\"CityName\":\"威海市\(zhòng)"},{\"CityID\":\"145\",\"CityName\":\"日照市\(zhòng)"},{\"CityID\":\"146\",\"CityName\":\"萊蕪市\(zhòng)"},{\"CityID\":\"147\",\"CityName\":\"臨沂市\(zhòng)"},{\"CityID\":\"148\",\"CityName\":\"德州市\(zhòng)"},{\"CityID\":\"149\",\"CityName\":\"聊城市\(zhòng)"},{\"CityID\":\"150\",\"CityName\":\"濱州市\(zhòng)"},{\"CityID\":\"151\",\"CityName\":\"荷澤市\(zhòng)"}]},
{\"ProvinceID\":\"16\",\"Province\":\"河南省\",\"City\":[{\"CityID\":\"152\",\"CityName\":\"鄭州市\(zhòng)"},{\"CityID\":\"153\",\"CityName\":\"開封市\(zhòng)"},{\"CityID\":\"154\",\"CityName\":\"洛陽市\(zhòng)"},{\"CityID\":\"155\",\"CityName\":\"平頂山市\(zhòng)"},{\"CityID\":\"156\",\"CityName\":\"安陽市\(zhòng)"},{\"CityID\":\"157\",\"CityName\":\"鶴壁市\(zhòng)"},{\"CityID\":\"158\",\"CityName\":\"新鄉(xiāng)市\(zhòng)"},{\"CityID\":\"159\",\"CityName\":\"焦作市\(zhòng)"},{\"CityID\":\"160\",\"CityName\":\"濮陽市\(zhòng)"},{\"CityID\":\"161\",\"CityName\":\"許昌市\(zhòng)"},{\"CityID\":\"162\",\"CityName\":\"漯河市\(zhòng)"},{\"CityID\":\"163\",\"CityName\":\"三門峽市\(zhòng)"},{\"CityID\":\"164\",\"CityName\":\"南陽市\(zhòng)"},{\"CityID\":\"165\",\"CityName\":\"商丘市\(zhòng)"},{\"CityID\":\"166\",\"CityName\":\"信陽市\(zhòng)"},{\"CityID\":\"167\",\"CityName\":\"周口市\(zhòng)"},{\"CityID\":\"168\",\"CityName\":\"駐馬店市\(zhòng)"}]},
{\"ProvinceID\":\"17\",\"Province\":\"湖北省\",\"City\":[{\"CityID\":\"169\",\"CityName\":\"武漢市\(zhòng)"},{\"CityID\":\"170\",\"CityName\":\"黃石市\(zhòng)"},{\"CityID\":\"171\",\"CityName\":\"十堰市\(zhòng)"},{\"CityID\":\"172\",\"CityName\":\"宜昌市\(zhòng)"},{\"CityID\":\"173\",\"CityName\":\"襄樊市\(zhòng)"},{\"CityID\":\"174\",\"CityName\":\"鄂州市\(zhòng)"},{\"CityID\":\"175\",\"CityName\":\"荊門市\(zhòng)"},{\"CityID\":\"176\",\"CityName\":\"孝感市\(zhòng)"},{\"CityID\":\"177\",\"CityName\":\"荊州市\(zhòng)"},{\"CityID\":\"178\",\"CityName\":\"黃岡市\(zhòng)"},{\"CityID\":\"179\",\"CityName\":\"咸寧市\(zhòng)"},{\"CityID\":\"180\",\"CityName\":\"隨州市\(zhòng)"},{\"CityID\":\"181\",\"CityName\":\"恩施土家族苗族自治州\"},{\"CityID\":\"182\",\"CityName\":\"神農(nóng)架\"}]},
{\"ProvinceID\":\"18\",\"Province\":\"湖南省\",\"City\":[{\"CityID\":\"183\",\"CityName\":\"長沙市\(zhòng)"},{\"CityID\":\"184\",\"CityName\":\"株洲市\(zhòng)"},{\"CityID\":\"185\",\"CityName\":\"湘潭市\(zhòng)"},{\"CityID\":\"186\",\"CityName\":\"衡陽市\(zhòng)"},{\"CityID\":\"187\",\"CityName\":\"邵陽市\(zhòng)"},{\"CityID\":\"188\",\"CityName\":\"岳陽市\(zhòng)"},{\"CityID\":\"189\",\"CityName\":\"常德市\(zhòng)"},{\"CityID\":\"190\",\"CityName\":\"張家界市\(zhòng)"},{\"CityID\":\"191\",\"CityName\":\"益陽市\(zhòng)"},{\"CityID\":\"192\",\"CityName\":\"郴州市\(zhòng)"},{\"CityID\":\"193\",\"CityName\":\"永州市\(zhòng)"},{\"CityID\":\"194\",\"CityName\":\"懷化市\(zhòng)"},{\"CityID\":\"195\",\"CityName\":\"婁底市\(zhòng)"},{\"CityID\":\"196\",\"CityName\":\"湘西土家族苗族自治州\"}]},
{\"ProvinceID\":\"19\",\"Province\":\"廣東省\",\"City\":[{\"CityID\":\"197\",\"CityName\":\"廣州市\(zhòng)"},{\"CityID\":\"198\",\"CityName\":\"韶關(guān)市\(zhòng)"},{\"CityID\":\"199\",\"CityName\":\"深圳市\(zhòng)"},{\"CityID\":\"200\",\"CityName\":\"珠海市\(zhòng)"},{\"CityID\":\"201\",\"CityName\":\"汕頭市\(zhòng)"},{\"CityID\":\"202\",\"CityName\":\"佛山市\(zhòng)"},{\"CityID\":\"203\",\"CityName\":\"江門市\(zhòng)"},{\"CityID\":\"204\",\"CityName\":\"湛江市\(zhòng)"},{\"CityID\":\"205\",\"CityName\":\"茂名市\(zhòng)"},{\"CityID\":\"206\",\"CityName\":\"肇慶市\(zhòng)"},{\"CityID\":\"207\",\"CityName\":\"惠州市\(zhòng)"},{\"CityID\":\"208\",\"CityName\":\"梅州市\(zhòng)"},{\"CityID\":\"209\",\"CityName\":\"汕尾市\(zhòng)"},{\"CityID\":\"210\",\"CityName\":\"河源市\(zhòng)"},{\"CityID\":\"211\",\"CityName\":\"陽江市\(zhòng)"},{\"CityID\":\"212\",\"CityName\":\"清遠(yuǎn)市\(zhòng)"},{\"CityID\":\"213\",\"CityName\":\"東莞市\(zhòng)"},{\"CityID\":\"214\",\"CityName\":\"中山市\(zhòng)"},{\"CityID\":\"215\",\"CityName\":\"潮州市\(zhòng)"},{\"CityID\":\"216\",\"CityName\":\"揭陽市\(zhòng)"},{\"CityID\":\"217\",\"CityName\":\"云浮市\(zhòng)"}]},
{\"ProvinceID\":\"20\",\"Province\":\"廣西壯族自治區(qū)\",\"City\":[{\"CityID\":\"218\",\"CityName\":\"南寧市\(zhòng)"},{\"CityID\":\"219\",\"CityName\":\"柳州市\(zhòng)"},{\"CityID\":\"220\",\"CityName\":\"桂林市\(zhòng)"},{\"CityID\":\"221\",\"CityName\":\"梧州市\(zhòng)"},{\"CityID\":\"222\",\"CityName\":\"北海市\(zhòng)"},{\"CityID\":\"223\",\"CityName\":\"防城港市\(zhòng)"},{\"CityID\":\"224\",\"CityName\":\"欽州市\(zhòng)"},{\"CityID\":\"225\",\"CityName\":\"貴港市\(zhòng)"},{\"CityID\":\"226\",\"CityName\":\"玉林市\(zhòng)"},{\"CityID\":\"227\",\"CityName\":\"百色市\(zhòng)"},{\"CityID\":\"228\",\"CityName\":\"賀州市\(zhòng)"},{\"CityID\":\"229\",\"CityName\":\"河池市\(zhòng)"},{\"CityID\":\"230\",\"CityName\":\"來賓市\(zhòng)"},{\"CityID\":\"231\",\"CityName\":\"崇左市\(zhòng)"}]},
{\"ProvinceID\":\"21\",\"Province\":\"海南省\",\"City\":[{\"CityID\":\"232\",\"CityName\":\"??谑衆(zhòng)"},{\"CityID\":\"233\",\"CityName\":\"三亞市\(zhòng)"}]},
{\"ProvinceID\":\"22\",\"Province\":\"重慶市\(zhòng)",\"City\":[{\"CityID\":\"234\",\"CityName\":\"重慶市\(zhòng)"}]},
{\"ProvinceID\":\"23\",\"Province\":\"四川省\",\"City\":[{\"CityID\":\"235\",\"CityName\":\"成都市\(zhòng)"},{\"CityID\":\"236\",\"CityName\":\"自貢市\(zhòng)"},{\"CityID\":\"237\",\"CityName\":\"攀枝花市\(zhòng)"},{\"CityID\":\"238\",\"CityName\":\"瀘州市\(zhòng)"},{\"CityID\":\"239\",\"CityName\":\"德陽市\(zhòng)"},{\"CityID\":\"240\",\"CityName\":\"綿陽市\(zhòng)"},{\"CityID\":\"241\",\"CityName\":\"廣元市\(zhòng)"},{\"CityID\":\"242\",\"CityName\":\"遂寧市\(zhòng)"},{\"CityID\":\"243\",\"CityName\":\"內(nèi)江市\(zhòng)"},{\"CityID\":\"244\",\"CityName\":\"樂山市\(zhòng)"},{\"CityID\":\"245\",\"CityName\":\"南充市\(zhòng)"},{\"CityID\":\"246\",\"CityName\":\"眉山市\(zhòng)"},{\"CityID\":\"247\",\"CityName\":\"宜賓市\(zhòng)"},{\"CityID\":\"248\",\"CityName\":\"廣安市\(zhòng)"},{\"CityID\":\"249\",\"CityName\":\"達(dá)州市\(zhòng)"},{\"CityID\":\"250\",\"CityName\":\"雅安市\(zhòng)"},{\"CityID\":\"251\",\"CityName\":\"巴中市\(zhòng)"},{\"CityID\":\"252\",\"CityName\":\"資陽市\(zhòng)"},{\"CityID\":\"253\",\"CityName\":\"阿壩藏族羌族自治州\"},{\"CityID\":\"254\",\"CityName\":\"甘孜藏族自治州\"},{\"CityID\":\"255\",\"CityName\":\"涼山彝族自治州\"}]},
{\"ProvinceID\":\"24\",\"Province\":\"貴州省\",\"City\":[{\"CityID\":\"256\",\"CityName\":\"貴陽市\(zhòng)"},{\"CityID\":\"257\",\"CityName\":\"六盤水市\(zhòng)"},{\"CityID\":\"258\",\"CityName\":\"遵義市\(zhòng)"},{\"CityID\":\"259\",\"CityName\":\"安順市\(zhòng)"},{\"CityID\":\"260\",\"CityName\":\"銅仁地區(qū)\"},{\"CityID\":\"261\",\"CityName\":\"黔西南布依族苗族自治州\"},{\"CityID\":\"262\",\"CityName\":\"畢節(jié)地區(qū)\"},{\"CityID\":\"263\",\"CityName\":\"黔東南苗族侗族自治州\"},{\"CityID\":\"264\",\"CityName\":\"黔南布依族苗族自治州\"}]},
{\"ProvinceID\":\"25\",\"Province\":\"云南省\",\"City\":[{\"CityID\":\"265\",\"CityName\":\"昆明市\(zhòng)"},{\"CityID\":\"266\",\"CityName\":\"曲靖市\(zhòng)"},{\"CityID\":\"267\",\"CityName\":\"玉溪市\(zhòng)"},{\"CityID\":\"268\",\"CityName\":\"保山市\(zhòng)"},{\"CityID\":\"269\",\"CityName\":\"昭通市\(zhòng)"},{\"CityID\":\"270\",\"CityName\":\"麗江市\(zhòng)"},{\"CityID\":\"271\",\"CityName\":\"思茅市\(zhòng)"},{\"CityID\":\"272\",\"CityName\":\"臨滄市\(zhòng)"},{\"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\":\"西藏自治區(qū)\",\"City\":[{\"CityID\":\"281\",\"CityName\":\"拉薩市\(zhòng)"},{\"CityID\":\"282\",\"CityName\":\"昌都地區(qū)\"},{\"CityID\":\"283\",\"CityName\":\"山南地區(qū)\"},{\"CityID\":\"284\",\"CityName\":\"日喀則地區(qū)\"},{\"CityID\":\"285\",\"CityName\":\"那曲地區(qū)\"},{\"CityID\":\"286\",\"CityName\":\"阿里地區(qū)\"},{\"CityID\":\"287\",\"CityName\":\"林芝地區(qū)\"}]},
{\"ProvinceID\":\"27\",\"Province\":\"陜西省\",\"City\":[{\"CityID\":\"288\",\"CityName\":\"西安市\(zhòng)"},{\"CityID\":\"289\",\"CityName\":\"銅川市\(zhòng)"},{\"CityID\":\"290\",\"CityName\":\"寶雞市\(zhòng)"},{\"CityID\":\"291\",\"CityName\":\"咸陽市\(zhòng)"},{\"CityID\":\"292\",\"CityName\":\"渭南市\(zhòng)"},{\"CityID\":\"293\",\"CityName\":\"延安市\(zhòng)"},{\"CityID\":\"294\",\"CityName\":\"漢中市\(zhòng)"},{\"CityID\":\"295\",\"CityName\":\"榆林市\(zhòng)"},{\"CityID\":\"296\",\"CityName\":\"安康市\(zhòng)"},{\"CityID\":\"297\",\"CityName\":\"商洛市\(zhòng)"}]},
{\"ProvinceID\":\"28\",\"Province\":\"甘肅省\",\"City\":[{\"CityID\":\"298\",\"CityName\":\"蘭州市\(zhòng)"},{\"CityID\":\"299\",\"CityName\":\"嘉峪關(guān)市\(zhòng)"},{\"CityID\":\"300\",\"CityName\":\"金昌市\(zhòng)"},{\"CityID\":\"301\",\"CityName\":\"白銀市\(zhòng)"},{\"CityID\":\"302\",\"CityName\":\"天水市\(zhòng)"},{\"CityID\":\"303\",\"CityName\":\"武威市\(zhòng)"},{\"CityID\":\"304\",\"CityName\":\"張掖市\(zhòng)"},{\"CityID\":\"305\",\"CityName\":\"平?jīng)鍪衆(zhòng)"},{\"CityID\":\"306\",\"CityName\":\"酒泉市\(zhòng)"},{\"CityID\":\"307\",\"CityName\":\"慶陽市\(zhòng)"},{\"CityID\":\"308\",\"CityName\":\"定西市\(zhòng)"},{\"CityID\":\"309\",\"CityName\":\"隴南市\(zhòng)"},{\"CityID\":\"310\",\"CityName\":\"臨夏回族自治州\"},{\"CityID\":\"311\",\"CityName\":\"甘南藏族自治州\"}]},
{\"ProvinceID\":\"29\",\"Province\":\"青海省\",\"City\":[{\"CityID\":\"312\",\"CityName\":\"西寧市\(zhòng)"},{\"CityID\":\"313\",\"CityName\":\"海東地區(qū)\"},{\"CityID\":\"314\",\"CityName\":\"海北藏族自治州\"},{\"CityID\":\"315\",\"CityName\":\"黃南藏族自治州\"},{\"CityID\":\"316\",\"CityName\":\"海南藏族自治州\"},{\"CityID\":\"317\",\"CityName\":\"果洛藏族自治州\"},{\"CityID\":\"318\",\"CityName\":\"玉樹藏族自治州\"},{\"CityID\":\"319\",\"CityName\":\"海西蒙古族藏族自治州\"}]},
{\"ProvinceID\":\"30\",\"Province\":\"寧夏回族自治區(qū)\",\"City\":[{\"CityID\":\"320\",\"CityName\":\"銀川市\(zhòng)"},{\"CityID\":\"321\",\"CityName\":\"石嘴山市\(zhòng)"},{\"CityID\":\"322\",\"CityName\":\"吳忠市\(zhòng)"},{\"CityID\":\"323\",\"CityName\":\"固原市\(zhòng)"},{\"CityID\":\"324\",\"CityName\":\"中衛(wèi)市\(zhòng)"}]},
{\"ProvinceID\":\"31\",\"Province\":\"新疆維吾爾自治區(qū)\",\"City\":[{\"CityID\":\"325\",\"CityName\":\"烏魯木齊市\(zhòng)"},{\"CityID\":\"326\",\"CityName\":\"克拉瑪依市\(zhòng)"},{\"CityID\":\"327\",\"CityName\":\"吐魯番地區(qū)\"},{\"CityID\":\"328\",\"CityName\":\"哈密地區(qū)\"},{\"CityID\":\"329\",\"CityName\":\"昌吉回族自治州\"},{\"CityID\":\"330\",\"CityName\":\"博爾塔拉蒙古自治州\"},{\"CityID\":\"331\",\"CityName\":\"巴音郭楞蒙古自治州\"},{\"CityID\":\"332\",\"CityName\":\"阿克蘇地區(qū)\"},{\"CityID\":\"333\",\"CityName\":\"克孜勒蘇柯爾克孜自治州\"},{\"CityID\":\"334\",\"CityName\":\"喀什地區(qū)\"},{\"CityID\":\"335\",\"CityName\":\"和田地區(qū)\"},{\"CityID\":\"336\",\"CityName\":\"伊犁哈薩克自治州\"},{\"CityID\":\"337\",\"CityName\":\"塔城地區(qū)\"},{\"CityID\":\"338\",\"CityName\":\"阿勒泰地區(qū)\"},{\"CityID\":\"339\",\"CityName\":\"石河子市\(zhòng)"},{\"CityID\":\"340\",\"CityName\":\"阿拉爾市\(zhòng)"},{\"CityID\":\"341\",\"CityName\":\"圖木舒克市\(zhòng)"},{\"CityID\":\"342\",\"CityName\":\"五家渠市\(zhòng)"}]},
{\"ProvinceID\":\"32\",\"Province\":\"香港特別行政區(qū)\",\"City\":[{\"CityID\":\"343\",\"CityName\":\"香港特別行政區(qū)\"}]},
{\"ProvinceID\":\"33\",\"Province\":\"澳門特別行政區(qū)\",\"City\":[{\"CityID\":\"344\",\"CityName\":\"澳門特別行政區(qū)\"}]},
{\"ProvinceID\":\"34\",\"Province\":\"臺灣省\",\"City\":[{\"CityID\":\"345\",\"CityName\":\"臺灣省\"}]}}
您可能感興趣的文章:
  • 用Promise解決多個異步Ajax請求導(dǎo)致的代碼嵌套問題(完美解決方案)
  • 雙層ajax嵌套(可多層)用法實(shí)例
  • 詳解JavaScript原生封裝ajax請求和Jquery中的ajax請求
  • JQuery實(shí)現(xiàn)ajax請求的示例和注意事項(xiàng)
  • JQuery Ajax執(zhí)行跨域請求數(shù)據(jù)的解決方案
  • JQuery的Ajax請求實(shí)現(xiàn)局部刷新的簡單實(shí)例
  • jquery的ajax異步請求接收返回json數(shù)據(jù)實(shí)例
  • JQuery的Ajax跨域請求原理概述及實(shí)例
  • jQuery實(shí)現(xiàn)ajax的嵌套請求案例分析

標(biāo)簽:佛山 荊州 揭陽 咸寧 商洛 辛集 股票 紅河

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Ajax請求內(nèi)嵌套Ajax請求示例代碼》,本文關(guān)鍵詞  Ajax,請求,內(nèi),嵌套,示例,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Ajax請求內(nèi)嵌套Ajax請求示例代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于Ajax請求內(nèi)嵌套Ajax請求示例代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章