document.getElementById("DropDownList1")

解决方案 »

  1.   

    都改成了document.getElementById("DropDownList1")形式,还是不行啊
      

  2.   

    在firefox上,从服务器就无法返回了,不知道怎么回事
      

  3.   

    var XmlHttp;
    if(window.ActiveXObject){
    XmlHttp=new ActiveXObject("Microsoft.XmlHttp");
    }else if(window.XMLHttpRequest){
    XmlHttp=new XMLHttpRequest();
    //alert(XmlHttp);
    }

    function sendAJAX(par)
    {
    XmlHttp.open("POST","receive.aspx",true);
    XmlHttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
    XmlHttp.send(par);
    XmlHttp.onreadystatechange=ServerProcess;
    }
    function ServerProcess()
    {
    if (XmlHttp.readyState==4 || XmlHttp.status==200)
    {
    var obj = document.getElementById("DropDownList1");
    obj.style.display="";
    var s=XmlHttp.responseText;
    var al=s.split(";");
    obj.options.length = 0;
    for(var i=0;i<al.length;i++)
    {
    obj.options[obj.options.length] = new Option(al[i],al[i]);
    }
    }
    }
      

  4.   

    微软软件基本都是默认不区分大小写。*nix下的软件默认大小写严格区分。
      

  5.   

    document.all是FF支持的
    原因肯定不在这里
      

  6.   

    XmlHttp=new ActiveXObject("Microsoft.XMLhttp");
    这个在FF下不能用的.
    用类似下面的方法创建xmlhttp,以适应不同的浏览器.
    function sajax_init_object()
    {
    var A = null ;
    try {
    A=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
    try {
    A=new ActiveXObject("Microsoft.XMLHTTP");
    } catch (oc) {
    A=null;
    }
    }
    if(!A && typeof XMLHttpRequest != "undefined")
    A = new XMLHttpRequest();
    return A;
    }
      

  7.   

    function lib_bwcheck(){ //兼容性处理代码
    this.ver=navigator.appVersion; 
    this.agent=navigator.userAgent
    this.dom=document.getElementById?1:0
    this.win = (navigator.appVersion.indexOf("Win")>0);
      this.xwin = (navigator.appVersion.indexOf("X11")>0);
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ie=this.ie4||this.ie5||this.ie6
    this.mac=this.agent.indexOf("Mac")>-1
    this.opera5=this.agent.indexOf("Opera 5")>-1
    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom||false);
        this.width = null;
        this.height = null;
    return this
    }var bw = new lib_bwcheck();function getObjectById( ID ) {
    if (bw.ns6) return top.document.getElementById(ID);
    else if (bw.ns) return top.document.layers[ID];
    else return top.document.all[ID];
    }

    上面的是兼容性处理代码