省市二级跳转菜单




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>


<head>
<script language="javascript">
function navigate(link)
{
var Objlink=document.getElementById(link)
var href=Objlink.options[Objlink.selectedIndex].value
if(href)
window.location=href
}
</script>
</head>
<select name="example" size="1"  id=link onChange="navigate('link')">
<option value="">请选择</option>
<option value="http://www.baidu.com">百度</option>
<option value="http://www.google.cn">google</option>
<option value="http://www.yahoo.cn">雅虎</option>
</select>


</BODY>
</HTML>




引用内容 引用内容

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>

<script language="JavaScript">
<!--
var g_selProvince;
var g_selCity;
var Provinces=new Array(
new Array("110000","北京市"),
new Array("120000","天津市"),
new Array("130000","河北省"),
new Array("140000","山西省"),
new Array("150000","内蒙古自治区"),
new Array("210000","辽宁省"),
new Array("220000","吉林省"),
new Array("230000","黑龙江省"),
new Array("310000","上海市"),
new Array("320000","江苏省"),
new Array("330000","浙江省"),
new Array("340000","安徽省"),
new Array("350000","福建省"),
new Array("360000","江西省"),
new Array("370000","山东省"),
new Array("410000","河南省"),
new Array("420000","湖北省"),
new Array("430000","湖南省"),
new Array("440000","广东省"),
new Array("450000","广西壮族自治区"),
new Array("460000","海南省"),
new Array("500000","重庆市"),
new Array("510000","四川省"),
new Array("520000","贵州省"),
new Array("530000","云南省"),
new Array("540000","西藏自治区"),
new Array("610000","陕西省"),
new Array("620000","甘肃省"),
new Array("630000","青海省"),
new Array("640000","宁夏回族自治区"),
new Array("650000","新疆维吾尔自治区"),
new Array("710000","台湾省"),
new Array("810000","香港特别行政区"),
new Array("820000","澳门特别行政区")
);
var Citys=new Array(
new Array("110100","北京","http://bbs.dogsky.com/forumdisplay.php?fid=64"),
new Array("120100","天津","http://bbs.dogsky.com/forumdisplay.php?fid=67"),
new Array("130101","石家庄","http://bbs.dogsky.com/forumdisplay.php?fid=104"),
new Array("130201","唐山","http://bbs.dogsky.com/forumdisplay.php?fid=105"),
new Array("130301","秦皇岛","http://bbs.dogsky.com/forumdisplay.php?fid=106"),
new Array("130701","张家口","http://bbs.dogsky.com/forumdisplay.php?fid=107"),
new Array("130801","承德","http://bbs.dogsky.com/forumdisplay.php?fid=108"),
new Array("131001","廊坊","http://bbs.dogsky.com/forumdisplay.php?fid=109"),
new Array("130401","邯郸","http://bbs.dogsky.com/forumdisplay.php?fid=110"),
new Array("130501","邢台","http://bbs.dogsky.com/forumdisplay.php?fid=111"),
new Array("130601","保定","http://bbs.dogsky.com/forumdisplay.php?fid=112"),
new Array("130901","沧州","http://bbs.dogsky.com/forumdisplay.php?fid=113"),
new Array("133001","衡水","http://bbs.dogsky.com/forumdisplay.php?fid=114"),
new Array("140101","太原","http://bbs.dogsky.com/forumdisplay.php?fid=115"),
new Array("140201","大同","http://bbs.dogsky.com/forumdisplay.php?fid=116"),
new Array("140301","阳泉","http://bbs.dogsky.com/forumdisplay.php?fid=117"),
new Array("140501","晋城","http://bbs.dogsky.com/forumdisplay.php?fid=118"),
new Array("140601","朔州","http://bbs.dogsky.com/forumdisplay.php?fid=119"),
new Array("142201","忻州","http://bbs.dogsky.com/forumdisplay.php?fid=120"),
new Array("142331","吕梁","http://bbs.dogsky.com/forumdisplay.php?fid=121"),
new Array("142401","晋中","http://bbs.dogsky.com/forumdisplay.php?fid=122"),
new Array("142601","临汾","http://bbs.dogsky.com/forumdisplay.php?fid=123"),
new Array("142701","运城","http://bbs.dogsky.com/forumdisplay.php?fid=124"),
new Array("140401","长治","http://bbs.dogsky.com/forumdisplay.php?fid=125"),
new Array("150101","呼和浩特","http://bbs.dogsky.com/forumdisplay.php?fid=126"),
new Array("150201","包头","http://bbs.dogsky.com/forumdisplay.php?fid=127"),
new Array("150301","乌海","http://bbs.dogsky.com/forumdisplay.php?fid=128"),
new Array("152601","集宁","http://bbs.dogsky.com/forumdisplay.php?fid=129"),
new Array("152701","东胜","http://bbs.dogsky.com/forumdisplay.php?fid=130"),
new Array("152801","临河","http://bbs.dogsky.com/forumdisplay.php?fid=131"),
new Array("152921","阿拉善左旗","http://bbs.dogsky.com/forumdisplay.php?fid=132"),
new Array("150401","赤峰","http://bbs.dogsky.com/forumdisplay.php?fid=133"),
new Array("152301","通辽","http://bbs.dogsky.com/forumdisplay.php?fid=134"),
new Array("152502","锡林浩特","http://bbs.dogsky.com/forumdisplay.php?fid=135"),
new Array("152101","海拉尔","http://bbs.dogsky.com/forumdisplay.php?fid=136"),
new Array("152201","乌兰浩特","http://bbs.dogsky.com/forumdisplay.php?fid=137"),
new Array("210101","沈阳","http://bbs.dogsky.com/forumdisplay.php?fid=138"),
new Array("210201","大连","http://bbs.dogsky.com/forumdisplay.php?fid=139"),
new Array("210301","鞍山","http://bbs.dogsky.com/forumdisplay.php?fid=140"),
new Array("210401","抚顺","http://bbs.dogsky.com/forumdisplay.php?fid=141"),
new Array("210501","本溪","http://bbs.dogsky.com/forumdisplay.php?fid=142"),
new Array("210701","锦州","http://bbs.dogsky.com/forumdisplay.php?fid=143"),
new Array("210801","营口","http://bbs.dogsky.com/forumdisplay.php?fid=144"),
new Array("210901","阜新","http://bbs.dogsky.com/forumdisplay.php?fid=145"),
new Array("211101","盘锦","http://bbs.dogsky.com/forumdisplay.php?fid=146"),
new Array("211201","铁岭","http://bbs.dogsky.com/forumdisplay.php?fid=147"),
new Array("211301","朝阳","http://bbs.dogsky.com/forumdisplay.php?fid=148"),
new Array("211401","锦西","http://bbs.dogsky.com/forumdisplay.php?fid=149"),
new Array("210601","丹东","http://bbs.dogsky.com/forumdisplay.php?fid=150"),
new Array("220101","长春","http://bbs.dogsky.com/forumdisplay.php?fid=152"),
new Array("220201","吉林","http://bbs.dogsky.com/forumdisplay.php?fid=153"),
new Array("220301","四平","http://bbs.dogsky.com/forumdisplay.php?fid=154"),
new Array("220401","辽源","http://bbs.dogsky.com/forumdisplay.php?fid=155"),
new Array("220601","浑江","http://bbs.dogsky.com/forumdisplay.php?fid=156"),
new Array("222301","白城","http://bbs.dogsky.com/forumdisplay.php?fid=157"),
new Array("222401","延吉","http://bbs.dogsky.com/forumdisplay.php?fid=158"),
new Array("220501","通化","http://bbs.dogsky.com/forumdisplay.php?fid=159"),
new Array("230101","哈尔滨","http://bbs.dogsky.com/forumdisplay.php?fid=160"),
new Array("230301","鸡西","http://bbs.dogsky.com/forumdisplay.php?fid=161"),
new Array("230401","鹤岗","http://bbs.dogsky.com/forumdisplay.php?fid=162"),
new Array("230501","双鸭山","http://bbs.dogsky.com/forumdisplay.php?fid=163"),
new Array("230701","伊春","http://bbs.dogsky.com/forumdisplay.php?fid=164"),
new Array("230801","佳木斯","http://bbs.dogsky.com/forumdisplay.php?fid=165"),
new Array("230901","七台河","http://bbs.dogsky.com/forumdisplay.php?fid=166"),
new Array("231001","牡丹江","http://bbs.dogsky.com/forumdisplay.php?fid=167"),
new Array("232301","绥化","http://bbs.dogsky.com/forumdisplay.php?fid=168"),
new Array("230201","齐齐哈尔","http://bbs.dogsky.com/forumdisplay.php?fid=169"),
new Array("230601","大庆","http://bbs.dogsky.com/forumdisplay.php?fid=170"),
new Array("232601","黑河","http://bbs.dogsky.com/forumdisplay.php?fid=171"),
new Array("232700","加格达奇","http://bbs.dogsky.com/forumdisplay.php?fid=172"),
new Array("310100","上海","http://bbs.dogsky.com/forumdisplay.php?fid=65"),
new Array("320101","南京","http://bbs.dogsky.com/forumdisplay.php?fid=173"),
new Array("654101","伊宁","http://bbs.dogsky.com/forumdisplay.php?fid=412"),
new Array("710001","台北","http://bbs.dogsky.com/forumdisplay.php?fid=414"),
new Array("710002","基隆","http://bbs.dogsky.com/forumdisplay.php?fid=415"),
new Array("710020","台南","http://bbs.dogsky.com/forumdisplay.php?fid=416"),
new Array("710019","高雄","http://bbs.dogsky.com/forumdisplay.php?fid=417"),
new Array("710008","台中","http://bbs.dogsky.com/forumdisplay.php?fid=418"),
new Array("211001","辽阳","http://bbs.dogsky.com/forumdisplay.php?fid=151"),
new Array("653201","和田","http://bbs.dogsky.com/forumdisplay.php?fid=413"),
new Array("542200","泽当镇","http://bbs.dogsky.com/forumdisplay.php?fid=364"),
new Array("542600","八一镇","http://bbs.dogsky.com/forumdisplay.php?fid=365"),
new Array("820000","澳门","http://bbs.dogsky.com/forumdisplay.php?fid=103"),
new Array("810000","香港","http://bbs.dogsky.com/forumdisplay.php?fid=102")
);
function FillProvinces(selProvince)
{
   // selProvince.options[0]=new Option("请选择","000000");
    for(i=0;i<Provinces.length;i++)
    {
        selProvince.options[i]=new Option(Provinces[i][1],Provinces[i][0]);
    }
    selProvince.options[0].selected=true;
    selProvince.length=i;
}
function FillCitys(selCity,ProvinceCode)
{
    //if the province is a direct-managed city, like Beijing, shanghai, tianjin, chongqin,hongkong, macro
        //need not "请选择选项"
             count=0;
    
    for(i=0;i<Citys.length;i++)
    {
        if(Citys[i][0].toString().substring(0,2)==ProvinceCode.substring(0,2))
        {
            selCity.options[count]=new Option(Citys[i][1],Citys[i][2]);
            count=count+1;
        }
    }
    selCity.options[0].selected=true;
    selCity.length=count;
       document.profile.urls.value=selCity.options[0].value
}
function Province_onchange()
{
    FillCitys(g_selCity,g_selProvince.value);
//              var Objlink=document.getElementById(document.profile.link)
//document.profile.value=
      
}
function InitCitySelect(selProvince,selCity)
{
    //alert("begin");
    g_selProvince=selProvince;
    g_selCity=selCity;
    selProvince.onchange=Function("Province_onchange();");
    FillProvinces(selProvince);
    Province_onchange();
}
function InitCitySelect2(selProvince,selCity,CityCode)
{
    InitCitySelect(selProvince,selCity)
    for(i=0;i<selProvince.length;i++)
    {
        if(selProvince.options[i].value.substring(0,2)==CityCode.substring(0,2))
        {
            selProvince.options[i].selected=true;
        }
    }
    Province_onchange();
    for(i=0;i<selCity.length;i++)
    {
        if(selCity.options[i].value==CityCode)
        {
            selCity.options[i].selected=true;
        }
    }
}
//-->
</script>
<form name="profile" method="post" action="">
<Select id=province size=1 name=province >
   <OPTION selected></OPTION>
</Select>
<Select id=city size=1 name=city onChange="navigate('city')">
  <OPTION selected></OPTION>
</Select>
<SCRIPT language=javascript>
InitCitySelect(document.profile.province,document.profile.city);
</SCRIPT>
<input type="button" onClick="forwar()" value="直达地方论坛">
<input type="hidden" name="urls" value="http://bbs.dogsky.com/forumdisplay.php?fid=64">
热门地区:<a href="http://bbs.dogsky.com/forumdisplay.php?fid=68">成都</a>
<a href="http://bbs.dogsky.com/forumdisplay.php?fid=65">上海</a>
</form>
<script language="javascript">
function navigate(link)
{
var Objlink=document.getElementById(link)
var href=Objlink.options[Objlink.selectedIndex].value
if(href)
//window.location=href
document.profile.urls.value=href
}
function forwar(){
window.location=document.profile.urls.value
}
function seturl(kk){
//var Objlink=document.getElementById(link)
//var href=Objlink.options[Objlink.selectedIndex].value
alert("href")
}
</script>


</BODY>
</HTML>






http://bbs.blueidea.com/thread-2767266-1-1.html

[本日志由 cmscn 于 2008-04-07 01:45 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 865
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 20 字 | UBB代码 关闭 | [img]标签 关闭