用 JS 动态载入 省份 和 城市
今天共享2个文件,使用 JavaScript 做一个 动态载入 省份 城市级联的效果。
给新手参考的资料代码, 但请尊重原创的劳动成果。 废话不多说, 分享代码如下:
现有创建一个 名字为: jsProvinceLineCity.js 文件。
[javascript]
var _city=new Array(35);
_city[0]=new Array(["请选择省份","请先选择省份"],[0,0]);
_city[1]=new Array(["北京","北京"],[2,201]);
_city[2]=new Array(["重庆","重庆"],[3,301]);
_city[3]=new Array(["福建","福州市","龙岩地区","南平地区","宁德地区","莆田市","泉州市","三明市","厦门市","漳州市"],[4,401,402,403,404,405,406,407,408,409]);
_city[4]=new Array(["甘肃","白银市","定西地区","甘南藏族自治州","嘉峪关市","金昌市","酒泉地区","兰州市","临夏回族自治州","陇南地区","平凉地区","庆阳地区","天水市","武威地区","张掖地区"],[5,501,502,503,504,505,506,507,508,509,510,511,512,513,514]);
_city[5]=new Array(["广东","潮州市","东莞市","佛山市","广州市","河源市","惠州市","江门市","揭阳市","茂名市","梅州市","清远市","汕头市","汕尾市","韶关市","深圳市","阳江市","湛江市","肇庆市","中山市","珠海市"],[6,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620]);
_city[6]=new Array(["广西","百色地区","北海市","桂林地区","桂林市","河池地区","柳州地区","柳州市","南宁地区","南宁市","钦州地区","梧州地区","梧州市","玉林地区"],[7,701,702,703,704,705,706,707,708,709,710,711,713]);
_city[7]=new Array(["贵州","安顺地区","毕节地区","贵阳市","六盘水市","黔东南苗族侗族自治州","黔南布依族苗族自治州","黔西南布依族苗族自治州","铜仁地区","遵义地区"],[8,801,802,803,804,805,806,807,808,809]);
_city[8]=new Array(["海南","白沙黎族自治县","保亭黎族苗族自治县","昌江黎族自治县","澄迈县","儋县","定安县","东方黎族自治县","海口市","乐东黎族自治县","临高县","陵水黎族自治县","南沙群岛","琼海市","琼山县","琼中黎族苗族自治县","三亚市","通什市","屯昌县","万宁县","文昌县","西沙群岛","中沙群岛的岛礁及其海域"],[9,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922]);
相关新闻>>
- 发表评论
-
- 最新评论 更多>>