資源描述:
《js實現(xiàn)省市級聯(lián)代碼》由會員上傳分享,免費在線閱讀,更多相關內容在教育資源-天天文庫。
1、js的寫法:place.js//province(省份類)functionprovinceList(){???this.length=36;???this[0]=newOption("不限","不限");???this[1]=newOption("北京","北京");???this[2]=newOption("重慶","重慶");???this[3]=newOption("福建","福建");???this[4]=newOption("甘肅","甘肅");???this[5]=newOption("廣東","廣東");???this[6]=newO
2、ption("廣西","廣西");???this[7]=newOption("貴州","貴州");???this[8]=newOption("海南","海南");???this[9]=newOption("河北","河北");???this[10]=newOption("河南","河南");???this[11]=newOption("黑龍江","黑龍江");???this[12]=newOption("湖北","湖北");???this[13]=newOption("湖南","湖南");???this[14]=newOption("江蘇","江蘇
3、");???this[15]=newOption("江西","江西");???this[16]=newOption("吉林","吉林");???this[17]=newOption("遼寧","遼寧");???this[18]=newOption("內蒙古","內蒙古");???this[19]=newOption("寧夏","寧夏");???this[20]=newOption("青海","青海");???this[21]=newOption("上海","上海");???this[22]=newOption("山東","山東");???this[
4、23]=newOption("山西","山西");???this[24]=newOption("陜西","陜西");???this[25]=newOption("四川","四川");???this[26]=newOption("天津","天津");???this[27]=newOption("新疆","新疆");???this[28]=newOption("西藏","西藏");???this[29]=newOption("云南","云南");???this[30]=newOption("浙江","浙江");???this[31]=newOption
5、("安徽","安徽");???this[32]=newOption("香港","香港");???this[33]=newOption("澳門","澳門");???this[34]=newOption("臺灣","臺灣");???this[35]=newOption("其它","其他");???returnthis;}//city(城市類)functioncitylist(){?this.length=36;?this[0]=newArray(1);?this[0][0]=newOption("不限","不限");???this[1]=newArra
6、y(1);???this[1][0]=newOption("北京市","北京市");???this[2]=newArray(4);???this[2][0]=newOption("重慶市","重慶市");???this[2][1]=newOption("涪陵市","涪陵市");???this[2][2]=newOption("黔江市","黔江市");???this[2][3]=newOption("萬縣市","萬縣市");???this[3]=newArray(9);???this[3][0]=newOption("福州市","福州市");???t
7、his[3][1]=newOption("龍巖市","龍巖市");???this[3][2]=newOption("南平市","南平市");???this[3][3]=newOption("寧德市","寧德市");???this[3][4]=newOption("莆田市","莆田市");???this[3][5]=newOption("泉州市","泉州市");???this[3][6]=newOption("三明市","三明市");???this[3][7]=newOption("廈門市","廈門市");???this[3][8]=newOptio
8、n("漳州市","漳州市");???this[4]=newArray(14);???this[4][0]=newOptio