标题:下列代碼為何無效??
只看楼主
rgbtdkjcel
Rank: 1
等 级:新手上路
帖 子:294
专家分:0
注 册:2007-3-26
结帖率:50%
 问题点数:0 回复次数:1 
下列代碼為何無效??
function changenext()
     {
       var select1=document.getElementById("selectcompany");
       var select2=document.getElementById("selectdept");
       var cobalt1dep=new Array("前台","經理室","國內市場部","行政部","資訊組","倉庫","塑膠部","裝備一部","裝備二部","品質部","採購部","PMC","工程部(樣板組)","工程部","工模部","生產總部","財務部","移噴部");
       var cobalt2dep=new Array("行政","工程","工程IE組","BOM","品質部","引線部","工程部","裝備三部","倉庫","喇叭","海棉");
       var hkdep=new Array("administration","acounting","sale&marketing","shipping","R&D","conference","國內廠專線電話");
      switch (select1.options[select1.selectedIndex].value)
      {
      case "高寶一廠":
        for (i=0;i<cobalt1dep.Length ;i++ )
        {
          alert(i);
         var o=new option(cobalt1dep[0],cobaltdep[0]);
          select2.appendChild(o);
        }
         
      case "高寶二廠":
           for (i2=0;i2<cobalt2dep.Length ;i2++ )
        {
          var e1=document.createElement("option");
          alert(e1);
          e1.text=cobalt1dep[i2];
          e1.value=cobalt1dep[i2];
          select2.appendChild(e1);
        }
      case "香港":
         
      }
      }
搜索更多相关主题的帖子: 何無效 var Array 工程部 
2007-12-18 15:55
渚薰
Rank: 6Rank: 6
等 级:贵宾
威 望:22
帖 子:1132
专家分:0
注 册:2006-8-6
得分:0 
cobalt1dep.Length
Length小写
cobalt1dep.length

select2.appendChild(o);

select2.options.push(o)

个人ajax技术专题站: " target="_blank">http://www. 我不会闲你烦,只会闲你不够烦!
2007-12-18 16:01



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-193159-1-1.html




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

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