| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 968 人关注过本帖
标题:一个注册表的代码看不懂呀!郁闷中。。
只看楼主 加入收藏
yangzeng
Rank: 1
等 级:新手上路
威 望:1
帖 子:277
专家分:0
注 册:2008-4-23
结帖率:100%
收藏
 问题点数:0 回复次数:6 
一个注册表的代码看不懂呀!郁闷中。。
function Dsy() { this.Items = {}; }
Dsy.prototype.add = function(id,iArray) { this.Items[id] = iArray; }
Dsy.prototype.Exists = function(id) { if(typeof(this.Items[id]) == "undefined") return false; return true; };
function change(v){
    var str="0";
    for(i=0;i<v;i++){ str+=("_"+(document.getElementById(s[i]).selectedIndex-1));};
    var ss=document.getElementById(s[v]);
        with(ss){
        length = 0;
            options[0]=new Option(opt0[v],opt0[v]);
        if(v && document.getElementById(s[v-1]).selectedIndex>0 || !v)
        {
            if(dsy.Exists(str)){
                ar = dsy.Items[str];
                for(i=0;i<ar.length;i++)options[length]=new Option(ar[i],ar[i]);
                if(v)options[1].selected = true;
            }
        }
        if(++v<s.length){change(v);}
    }
}


var dsy = new Dsy();
dsy.add("0",["安徽省","北京市","福建省","甘肃省","广东省","广西","贵州省","海南省","河北省","河南省","黑龙江省","湖北省","湖南省","吉林省","江苏省","江西省","辽宁省","内蒙古","宁夏","青海省","山东省","山西省","陕西省","上海市","四川省","台湾省","天津市","西藏","新疆","云南省","浙江省"]);  dsy.add("0_0",["安庆市","蚌埠市","巢湖地区","池州地区","滁州市","阜阳地区","合肥市","淮北市","淮南市","黄山市","六安地区","马鞍山市","宿县地区","铜陵市","芜湖市","宣城地区"]); dsy.add("0_2",["福州市","龙岩地区","南平地区","宁德地区","莆田市","泉州市","三明市","厦门市","漳州市"]);  dsy.add("0_3",["白银市","定西地区","甘南藏族自治州","嘉峪关市","金昌市","酒泉地区","兰州市","临夏回族自治州","陇南地区","平凉地区","庆阳地区","天水市","武威地区","张掖地区"]); dsy.add("0_4",["潮州市","东莞市","佛山市","广州市","河源市","惠州市","江门市","揭阳市","茂名市","梅州市","清远市","汕头市","汕尾市","韶关市","深圳市","阳江市","湛江市","肇庆市","中山市","珠海市"]); dsy.add("0_5",["百色地区","北海市","桂林地区","桂林市","河池地区","柳州地区","柳州市","南宁地区","南宁市","钦州地区","梧州地区","梧州市","玉林地区"]);  dsy.add("0_6",["安顺地区","毕节地区","贵阳市","六盘水市","黔东南苗族侗族自治州","黔南布依族苗族自治州","黔西南布依族苗族自治州","铜仁地区","遵义地区"]); dsy.add("0_7",["白沙黎族自治县","保亭黎族苗族自治县","昌江黎族自治县","澄迈县","儋县","定安县","东方黎族自治县","海口市","乐东黎族自治县","临高县","陵水黎族自治县","南沙群岛","琼海市","琼山县","琼中黎族苗族自治县","三亚市","通什市","屯昌县","万宁县","文昌县","西沙群岛","中沙群岛的岛礁及其海域"]);  dsy.add("0_8",["保定地区","保定市","沧州地区","沧州市","承德地区","承德市","邯郸地区","邯郸市","衡水地区","廊坊市","秦皇岛市","石家庄地区","石家庄市","唐山市","邢台地区","邢台市","张家口地区","张家口市"]); dsy.add("0_9",["安阳市","鹤壁市","焦作市","开封市","洛阳市","漯河市","南阳地区","平顶山市","濮阳市","三门峡市","商丘地区","新乡市","信阳地区","许昌市","郑州市","周口地区","驻马店地区"]); dsy.add("0_10",["大庆市","大兴安岭地区","哈尔滨市","鹤岗市","黑河地区","鸡西市","佳木斯市","牡丹江市","七台河市","齐齐哈尔市","双鸭山市","松花江地区","绥化地区","伊春市"]); dsy.add("0_11",["鄂西土家族苗族自治州","鄂州市","黄冈地区","黄石市","荆门市","荆州地区","沙市市","省直辖行政单位","十堰市","武汉市","咸宁地区","襄樊市","孝感地区","宜昌市","郧阳地区"]); dsy.add("0_12",["长沙市","常德市","郴州地区","大庸市","衡阳市","怀化地区","零陵地区","娄底地区","邵阳市","湘潭市","湘西土家族苗族自治州","益阳地区","岳阳市","株洲市"]); dsy.add("0_13",["白城地区","长春市","浑江市","吉林市","辽源市","四平市","松原市","通化市","延边朝鲜族自治州"]);  dsy.add("0_14",["常州市","淮阴市","连云港市","南京市","南通市","苏州市","无锡市","徐州市","盐城市","扬州市","镇江市"]); dsy.add("0_15",["抚州地区","赣州地区","吉安地区","景德镇市","九江市","南昌市","萍乡市","上饶地区","新余市","宜春地区","鹰潭市"]);  dsy.add("0_16",["鞍山市","本溪市","朝阳市","大连市","丹东市","抚顺市","阜新市","锦西市","锦州市","辽阳市","盘锦市","沈阳市","铁岭市","营口市"]); dsy.add("0_17",["阿拉善盟","巴彦淖尔盟","包头市","赤峰市","呼和浩特市","呼伦贝尔盟","乌海市","乌兰察布盟","锡林郭勒盟","兴安盟","伊克昭盟","哲里木盟"]);  dsy.add("0_18",["固原地区","石嘴山市","银川市","银南地区"]); dsy.add("0_19",["果洛藏族自治州","海北藏族自治州","海东地区","海南藏族自治州","海西蒙古族藏族自治州","黄南藏族自治州","西宁市","玉树藏族自治州"]);  dsy.add("0_20",["滨州地区","德州地区","东营市","菏泽地区","济南市","济宁市","莱芜市","聊城地区","临沂地区","青岛市","日照市","泰安市","威海市","潍坊市","烟台市","枣庄市","淄博市"]); dsy.add("0_21",["长治市","大同市","晋城市","晋中地区","临汾地区","吕梁地区","朔州市","太原市","忻州地区","雁北地区","阳泉市","运城地区"]); dsy.add("0_22",["安康地区","宝鸡市","汉中地区","商洛地区","铜川市","渭南地区","西安市","咸阳市","延安地区","榆林地区"]);  dsy.add("0_24",["阿坝藏族羌族自治州","成都市","达县地区","德阳市","涪陵地区","甘孜藏族自治州","广元市","乐山市","凉山彝族自治州","泸州市","绵阳市","内江市","南充地区","攀枝花市","黔江地区","遂宁市","万县市","雅安地区","宜宾地区","重庆市","自贡市"]);  dsy.add("0_27",["阿里地区","昌都地区","拉萨市","林芝地区","那曲地区","日喀则地区","山南地区"]);  dsy.add("0_28",["阿克苏地区","阿勒泰地区","巴音郭楞蒙古自治州","博尔塔拉蒙古自治州","昌吉回族自治州","哈密地区","和田地区","喀什地区","克拉玛依市","克孜勒苏柯尔克孜自治州","省直辖行政单位","塔城地区","吐鲁番地区","乌鲁木齐市","伊犁地区","伊犁哈萨克自治州"]);  dsy.add("0_29",["保山地区","楚雄彝族自治州","大理白族自治州","德宏傣族景颇族自治州","迪庆藏族自治州","东川市","红河哈尼族彝族自治州","昆明市","丽江地区","临沧地区","怒江傈僳族自治州","曲靖地区","思茅地区","文山壮族苗族自治州","西双版纳傣族自治州","玉溪地区","昭通地区"]);  dsy.add("0_30",["杭州市","湖州市","嘉兴市","金华市","丽水地区","宁波市","衢州市","绍兴市","台州地区","温州市","舟山市"]);
搜索更多相关主题的帖子: 注册表 function prototype document 
2008-08-14 20:36
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
列表菜单联动里面用了javascript的面向对象的技术
这段代码对于楼主来说的确是复杂了些
2008-08-15 10:00
yangzeng
Rank: 1
等 级:新手上路
威 望:1
帖 子:277
专家分:0
注 册:2008-4-23
收藏
得分:0 
你好版主!c从哪里可以学到这方面的东西,好像javascript里的教程里介绍的很少
2008-08-17 11:16
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
c语言是独立的语言,不过目前好多高级语言都是从c语言发展出来的。比如C++、C#(的主要服务器端语言)、java(JSP的主要服务器端语言)、javascript等,都是从C语言发展出来的。
目前个人所知C语言主要应用领域在于硬件编程(如某些驱动程序的底层代码),不过楼主的发展方向时ASP和.NET,可以只学习一下C语言的基础就可以没必要学习更深层次的内容。
2008-08-17 11:46
yangzeng
Rank: 1
等 级:新手上路
威 望:1
帖 子:277
专家分:0
注 册:2008-4-23
收藏
得分:0 
版主我打错了!
你好版主!从哪里可以学到我提问的这些代码方面的东西,好像javascript里的教程里介绍的很少
2008-08-17 12:35
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
javascript的面向对象属于javascript的高级技术。
2008-08-17 13:19
yangzeng
Rank: 1
等 级:新手上路
威 望:1
帖 子:277
专家分:0
注 册:2008-4-23
收藏
得分:0 
谢谢版主,我会学javascript的面向对象的高级技术的,
2008-08-17 13:36
快速回复:一个注册表的代码看不懂呀!郁闷中。。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047706 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved