javascript 省市二级关联菜单程序

var Citys=new Array(
new Array("101010100","北京"),
new Array("101030100","天津"),
new Array("101020100","上海"),
new Array("101040100","重庆"),
new Array("101320101","香港"),
new Array("101330101","澳门"),
new Array("101220101","合肥"),
new Array("101220201","蚌埠"),
new Array("101220301","芜湖"),
new Array("101220401","淮南"),
new Array("101220501","马鞍山"),
new Array("101220601","安庆"),
new Array("101220701","宿州"),
new Array("101220801","阜阳"),
new Array("101220901","亳州"),
new Array("101221001","黄山"),
new Array("101221101","滁州"),
new Array("101221201","淮北"),
new Array("101221301","铜陵"),
new Array("101221401","宣城"),
new Array("101221501","六安"),
new Array("101221601","巢湖"),
new Array("101221701","池州"),
new Array("101230101","福州"),
new Array("101230201","厦门"),
new Array("101230301","宁德"),
new Array("101230401","莆田"),
new Array("101230501","泉州"),
new Array("101230601","漳州"),
new Array("101230701","龙岩"),
new Array("101230801","三明"),
new Array("101230901","南平"),
new Array("101160101","兰州"),
new Array("101160201","定西"),
new Array("101160301","平凉"),
new Array("101160401","庆阳"),
new Array("101160501","武威"),
new Array("101160601","金昌"),
new Array("101160701","张掖"),
new Array("101160801","酒泉"),
new Array("101160901","天水"),
new Array("101161001","武都"),
new Array("101161101","临夏"),
new Array("101161201","合作"),
new Array("101161301","白银"),
new Array("101280101","广州"),
new Array("101280201","韶关"),
new Array("101280301","惠州"),
new Array("101280401","梅州"),
new Array("101280501","汕头"),
new Array("101280601","深圳"),
new Array("101280701","珠海"),
new Array("101280800","佛山"),
new Array("101280901","肇庆"),
new Array("101281001","湛江"),
new Array("101281101","江门"),
new Array("101281201","河源"),
new Array("101281301","清远"),
new Array("101281401","云浮"),
new Array("101281501","潮州"),
new Array("101281601","东莞"),
new Array("101281701","中山"),
new Array("101281801","阳江"),
new Array("101281901","揭阳"),
new Array("101282001","茂名"),
new Array("101282101","汕尾"),
new Array("101282105","东沙岛"),
new Array("101300101","南宁"),
new Array("101300201","崇左"),
new Array("101300301","柳州"),
new Array("101300401","来宾"),
new Array("101300501","桂林"),
new Array("101300601","梧州"),
new Array("101300701","贺州"),
new Array("101300801","贵港"),
new Array("101300901","玉林"),
new Array("101301001","百色"),
new Array("101301101","钦州"),
new Array("101301201","河池"),
new Array("101301301","北海"),
new Array("101301401","防城港"),
new Array("101260101","贵阳"),
new Array("101260201","遵义"),
new Array("101260301","安顺"),
new Array("101260401","都匀"),
new Array("101260501","凯里"),
new Array("101260601","铜仁"),
new Array("101260701","毕节"),
new Array("101260801","六盘水"),
new Array("101260901","黔西"),
new Array("101310101","海口"),
new Array("101310102","琼山"),
new Array("101310201","三亚"),
new Array("101310202","东方"),
new Array("101310203","临高"),
new Array("101310204","澄迈"),
new Array("101310205","儋州"),
new Array("101310206","昌江"),
new Array("101310207","白沙"),
new Array("101310208","琼中"),
new Array("101310209","定安"),
new Array("101310210","屯昌"),
new Array("101310211","琼海"),
new Array("101310212","文昌"),
new Array("101310213","清兰"),
new Array("101310214","保亭"),
new Array("101310215","万宁"),
new Array("101310216","陵水"),
new Array("101310217","西沙"),
new Array("101310218","珊瑚岛"),
new Array("101310219","永署礁"),
new Array("101310220","南沙岛"),
new Array("101310221","乐东"),
new Array("101310222","通什"),
new Array("101090101","石家庄"),
new Array("101090201","保定"),
new Array("101090301","张家口"),
new Array("101090402","承德市"),
new Array("101090501","唐山"),
new Array("101090601","廊坊"),
new Array("101090701","沧州"),
new Array("101090801","衡水"),
new Array("101090901","邢台"),
new Array("101091001","邯郸"),
new Array("101091101","秦皇岛"),
new Array("101180101","郑州"),
new Array("101180201","安阳"),
new Array("101180301","新乡"),
new Array("101180401","许昌"),
new Array("101180501","平顶山"),
new Array("101180601","信阳"),
new Array("101180701","南阳"),
new Array("101180801","开封"),
new Array("101180901","洛阳"),
new Array("101181001","商丘"),
new Array("101181101","焦作"),
new Array("101181201","鹤壁"),
new Array("101181301","濮阳"),
new Array("101181401","周口"),
new Array("101181501","漯河"),
new Array("101181601","驻马店"),
new Array("101181701","三门峡"),
new Array("101181801","济源"),
new Array("101050101","哈尔滨"),
new Array("101050201","齐齐哈尔"),
new Array("101050301","牡丹江"),
new Array("101050401","佳木斯"),
new Array("101050501","绥化"),
new Array("101050601","黑河"),
new Array("101050701","大兴安岭"),
new Array("101050801","伊春"),
new Array("101050901","大庆"),
new Array("101051002","七台河"),
new Array("101051101","鸡西"),
new Array("101051201","鹤岗"),
new Array("101051301","双鸭山"),
new Array("101200101","武汉"),
new Array("101200201","襄樊"),
new Array("101200301","鄂州"),
new Array("101200401","孝感"),
new Array("101200501","黄冈"),
new Array("101200601","黄石"),
new Array("101200701","咸宁"),
new Array("101200801","荆州"),
new Array("101200901","宜昌"),
new Array("101201001","恩施"),
new Array("101201101","十堰"),
new Array("101201201","神农架"),
new Array("101201301","随州"),
new Array("101201401","荆门"),
new Array("101201501","天门"),
new Array("101201601","仙桃"),
new Array("101201701","潜江"),
new Array("101250101","长沙"),
new Array("101250201","湘潭"),
new Array("101250301","株洲"),
new Array("101250401","衡阳"),
new Array("101250501","郴州"),
new Array("101250601","常德"),
new Array("101250701","益阳"),
new Array("101250801","娄底"),
new Array("101250901","邵阳"),
new Array("101251001","岳阳"),
new Array("101251101","张家界"),
new Array("101251201","怀化"),
new Array("101251301","黔阳"),
new Array("101251401","永州"),
new Array("101251501","吉首"),
new Array("101060101","长春"),
new Array("101060201","吉林"),
new Array("101060301","延吉"),
new Array("101060401","四平"),
new Array("101060501","通化"),
new Array("101060601","白城"),
new Array("101060701","辽源"),
new Array("101060801","松原"),
new Array("101060901","白山"),
new Array("101190101","南京"),
new Array("101190201","无锡"),
new Array("101190301","镇江"),
new Array("101190401","苏州"),
new Array("101190501","南通"),
new Array("101190601","扬州"),
new Array("101190701","盐城"),
new Array("101190801","徐州"),
new Array("101190901","淮安"),
new Array("101191001","连云港"),
new Array("101191101","常州"),
new Array("101191201","泰州"),
new Array("101191301","宿迁"),
new Array("101240101","南昌"),
new Array("101240201","九江"),
new Array("101240301","上饶"),
new Array("101240401","抚州"),
new Array("101240501","宜春"),
new Array("101240601","吉安"),
new Array("101240701","赣州"),
new Array("101240801","景德镇"),
new Array("101240901","萍乡"),
new Array("101241001","新余"),
new Array("101241101","鹰潭"),
new Array("101070101","沈阳"),
new Array("101070201","大连"),
new Array("101070301","鞍山"),
new Array("101070401","抚顺"),
new Array("101070501","本溪"),
new Array("101070601","丹东"),
new Array("101070701","锦州"),
new Array("101070801","营口"),
new Array("101070901","阜新"),
new Array("101071001","辽阳"),
new Array("101071101","铁岭"),
new Array("101071201","朝阳"),
new Array("101071301","盘锦"),
new Array("101071401","葫芦岛"),
new Array("101080101","呼和浩特"),
new Array("101080201","包头"),
new Array("101080301","乌海"),
new Array("101080401","集宁"),
new Array("101080501","通辽"),
new Array("101080601","赤峰"),
new Array("101080701","鄂尔多斯"),
new Array("101080801","临河"),
new Array("101080901","锡林浩特"),
new Array("101081000","呼伦贝尔"),
new Array("101081101","乌兰浩特"),
new Array("101081201","阿拉善左旗"),
new Array("101170101","银川"),
new Array("101170201","石嘴山"),
new Array("101170301","吴忠"),
new Array("101170401","固原"),
new Array("101170501","中卫"),
new Array("101150101","西宁"),
new Array("101150201","海东"),
new Array("101150301","黄南"),
new Array("101150401","海南"),
new Array("101150501","果洛"),
new Array("101150601","玉树"),
new Array("101150701","海西"),
new Array("101150801","海北"),
new Array("101120101","济南"),
new Array("101120201","青岛"),
new Array("101120301","淄博"),
new Array("101120401","德州"),
new Array("101120501","烟台"),
new Array("101120601","潍坊"),
new Array("101120701","济宁"),
new Array("101120801","泰安"),
new Array("101120901","临沂"),
new Array("101121001","菏泽"),
new Array("101121101","滨州"),
new Array("101121201","东营"),
new Array("101121301","威海"),
new Array("101121401","枣庄"),
new Array("101121501","日照"),
new Array("101121601","莱芜"),
new Array("101121701","聊城"),
new Array("101100101","太原"),
new Array("101100201","大同"),
new Array("101100301","阳泉"),
new Array("101100401","晋中"),
new Array("101100501","长治"),
new Array("101100601","晋城"),
new Array("101100701","临汾"),
new Array("101100801","运城"),
new Array("101100901","朔州"),
new Array("101101001","忻州"),
new Array("101101100","吕梁"),
new Array("101110101","西安"),
new Array("101110200","咸阳"),
new Array("101110300","延安"),
new Array("101110401","榆林"),
new Array("101110501","渭南"),
new Array("101110601","商洛"),
new Array("101110701","安康"),
new Array("101110801","汉中"),
new Array("101110901","宝鸡"),
new Array("101111001","铜川"),
new Array("101270101","成都"),
new Array("101270201","攀枝花"),
new Array("101270301","自贡"),
new Array("101270401","绵阳"),
new Array("101270501","南充"),
new Array("101270601","达州"),
new Array("101270701","遂宁"),
new Array("101270801","广安"),
new Array("101270901","巴中"),
new Array("101271001","泸州"),
new Array("101271101","宜宾"),
new Array("101271201","内江"),
new Array("101271301","资阳"),
new Array("101271401","乐山"),
new Array("101271501","眉山"),
new Array("101271601","凉山"),
new Array("101271701","雅安"),
new Array("101271801","甘孜"),
new Array("101271901","阿坝"),
new Array("101272001","德阳"),
new Array("101272101","广元"),
new Array("101340101","台北县"),
new Array("101340201","高雄"),
new Array("101340301","台南"),
new Array("101340401","台中"),
new Array("101340501","桃园"),
new Array("101340601","新竹县"),
new Array("101340701","宜兰"),
new Array("101340801","马公"),
new Array("101340901","嘉义"),
new Array("101341001","花莲"),
new Array("101341101","台东"),
new Array("101341201","彭佳屿"),
new Array("101140101","拉萨"),
new Array("101140201","日喀则"),
new Array("101140301","山南"),
new Array("101140401","林芝"),
new Array("101140501","昌都"),
new Array("101140601","那曲"),
new Array("101140701","阿里"),
new Array("101130101","乌鲁木齐"),
new Array("101130201","克拉玛依"),
new Array("101130301","石河子"),
new Array("101130401","昌吉"),
new Array("101130501","吐鲁番"),
new Array("101130601","库尔勒"),
new Array("101130701","阿拉尔"),
new Array("101130801","阿克苏"),
new Array("101130901","喀什"),
new Array("101131001","伊宁"),
new Array("101131101","塔城"),
new Array("101131201","哈密"),
new Array("101131301","和田"),
new Array("101131401","阿勒泰"),
new Array("101131501","阿图什"),
new Array("1011301601","博乐"),
new Array("101290101","昆明"),
new Array("101290201","大理"),
new Array("101290301","红河"),
new Array("101290401","曲靖"),
new Array("101290501","保山"),
new Array("101290601","文山"),
new Array("101290701","玉溪"),
new Array("101290801","楚雄"),
new Array("101290901","思茅"),
new Array("101291001","昭通"),
new Array("101291101","临沧"),
new Array("101291201","怒江"),
new Array("101291301","中甸"),
new Array("101291401","丽江"),
new Array("101291501","德宏"),
new Array("101291601","景洪"),
new Array("101210101","杭州"),
new Array("101210201","湖州"),
new Array("101210301","嘉兴"),
new Array("101210401","宁波"),
new Array("101210501","绍兴"),
new Array("101210601","台州"),
new Array("101210701","温州"),
new Array("101210801","丽水"),
new Array("101210901","金华"),
new Array("101211001","衢州"),
new Array("101211101","舟山")
);

var queryUrl="http://counter.sina.com.cn/ip";
if ( navigator.userAgent.toLowerCase().indexOf('msie') >= 0 ) {
  document.getElementById("IP_FORIE").src = queryUrl;
 } else {
  var js = document.createElement("script");
  js.setAttribute("type", "text/javascript");
  js.setAttribute("charset", "gb2312");
  js.setAttribute("src", queryUrl);
  document.body.insertBefore(js, null);
}
function ILData_callback()
{   var ip=ILData[0]; //ip
 var country = ILData[1];// 国家
 var province = ILData[2];// 省份
 var city = ILData[3];  // 地区
 var new_city_id = 101010100; //默认北京天气
 var cityname='北京';
 if(country != "" || province != "" || city != "")
 {
  coun_len = (country == "")?0:country.length;
  prov_len = (province == "")?0:province.length;
  city_len = (city == "")?0:city.length;
  
  for(i=0;i<Citys.length;i++)
  {
   min_coun_len = (coun_len==0)?0:((coun_len<Citys[i][1].length)?coun_len:Citys[i][1].length);
   min_prov_len = (prov_len==0)?0:((prov_len<Citys[i][1].length)?prov_len:Citys[i][1].length);
   min_city_len = (city_len==0)?0:((city_len<Citys[i][1].length)?city_len:Citys[i][1].length);

   if ((min_city_len!=0 && city.substr(0,min_city_len)==Citys[i][1].substr(0,min_city_len))
    || (min_prov_len!=0 && province.substr(0,min_prov_len)==Citys[i][1].substr(0,min_prov_len))
    || (min_coun_len!=0 && country.substr(0,min_coun_len)==Citys[i][1].substr(0,min_coun_len)))
   {
     new_city_id = Citys[i][0];
     cityname=Citys[i][1];
     break;
   }
  }     
 }else{
     new_city_id=101010100;
  cityname='北京';
 }
 
 var getid=getQueryString('id');
 
 if(getid=='')
 {
  getid=new_city_id;
 }
 
 startRequest("www.111cn.net?cityid="+getid,weatherifno); 
}
 
window.onerror=function(){
   return true;
}

时间: 2024-09-29 10:46:41

javascript 省市二级关联菜单程序的相关文章

javascript 省市二级联动菜单(1/2)

javascript教程 省市二级联动菜单 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.111cn.net/1999/xhtml"> <head> <meta

javascript省市二级级联菜单

提示:您可以先修改部分代码再运行 此JavaScript允许用户选择一个地区和世界第二位,然后在该地区的国家,特别是下拉菜单的变化 Select RegionAsiaAfricaAustraliaEuropeMiddle EastLatin AmericaNorth AmericaSouth America<-------------------- 提示:您可以先修改部分代码再运行

javascript 省市二级联动菜单代码(select 联动)

提示:您可以先修改部分代码再运行 调用: 提示:您可以先修改部分代码再运行

js下拉框二级关联菜单效果代码具体实现

这篇文章介绍了js下拉框二级关联菜单效果代码具体实现,有需要的朋友可以参考一下   复制代码 代码如下:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml&quo

基于Javascript实现二级联动菜单效果_javascript技巧

本文实例为大家分享了Javascript实现二级联动菜单效果的对应代码,具体内容如下 效果图如下: 具体实现步骤如下: 1.所用js代码如下: <script type="text/javascript"> var arr_province=["请选择省份/城市","北京市","上海市","天津市","河南省","山东省","河北省"]

javascript实现二级级联菜单的简单制作_javascript技巧

本文实例讲述了javascript实现二级级联菜单的简单制作方法.分享给大家供大家参考.具体如下: 运行效果截图如下: 具体代码如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="pragma" content="

php+js实现省市[select下拉列表]二级关联菜单效果

<head> <meta http-equiv="Content-Type" ontent="text/html; charset=gb2312" /> <title>表单元素[select下拉列表]制作二级联动菜单</title> <?php $link = mysql_connect('localhost','root','root') or die( mysql_error());   mysql_sele

js下拉框二级关联菜单效果代码

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  <html xmlns="http://www.w3.org/1999/xhtml">  <head>  <meta http-equiv="Cont

js下拉框二级关联菜单效果代码具体实现_javascript技巧

复制代码 代码如下:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv=&q