下面的代码在FF上没问题,但是在IE上却执行到open函数就不行了,求解啊~~~~~~~
function loadxml()
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.open("GET","pic_list.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;  
.................
.................
<body bgcolor="#999999" onload="loadxml();">

解决方案 »

  1.   

    var ajax = {//xmlhttp request
    tryList:function(){
    var xhr = null;
    for(var i=0;i<arguments.length;i++){
    var lambda = arguments[i];
    try{xhr = lambda();break;}catch(e){}
    }
    return xhr;
    },
    init:function(){
    return this.tryList(
    function(){return new ActiveXObject('MSXML2.XMLHttp.6.0');},
    function(){return new ActiveXObject('MSXML2.XMLHttp.3.0');},
    function(){return new XMLHttpRequest();},
    function(){return new ActiveXObject('MSXML2.XMLHttp.5.0');},
    function(){return new ActiveXObject('MSXML2.XMLHttp.4.0');},
    function(){return new ActiveXObject('Msxml2.XMLHTTP');},
    function(){return new ActiveXObject('MSXML.XMLHttp');},
    function(){return new ActiveXObject('Microsoft.XMLHTTP');}
    ) || null;
    }
    }
    var xmlhttp = ajax.init();
    xmlhttp.open("GET","pic_list.xml",false);
    xmlhttp.send(null);
    xmlDoc=xmlhttp.responseXML;