开源的 prototype jquery 为什么不用?? 自己写兼容性问题挺麻烦的.

解决方案 »

  1.   

    在firefox控制台下报的错误信息是uncaught exceptioin(...XMLHttpRequest。open...)省略的部分是乱码
      

  2.   

    可能是xmlhttp错误,参考:// Initialize
    var Try = {
    these: function(){
    var returnValue;
    for(var i=0; i<arguments.length; i++){
    var lambda = arguments[i];
    try{
    returnValue = lambda();
    break;
    }catch(e){}
    }
    return returnValue;
    }
    }function ajaxInitRV(){
    return Try.these(
    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;
    }function SendHttpPost(xmlHttp, url, args, callback) {
        xmlHttp.open("POST", url, /* async */ true);
        xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xmlHttp.onreadystatechange = function() { callback(xmlHttp); }
        xmlHttp.send(args);
    }function SendHttpGet(xmlHttp, url, callback) {
        xmlHttp.open("GET", url, /* async */ true);
        xmlHttp.onreadystatechange = function() { callback(xmlHttp); }
        xmlHttp.send("FOO");
    }
      

  3.   

    没使用过FireFox,第一次在CSDN上说话,顶一下:)
      

  4.   

    FF的话get请求
    send需要有参数比如ajax.send(null);
      

  5.   

    并且FF和IE的同步请求也有区别。。
      

  6.   

    哈哈,应当是跨域了,XMLHTTP的open方法抛出这个错误,一般都是跨域引起的...你看你的当前打开页面的URL,是不是跟localhost一样的.
      

  7.   

    谢谢,问题已经解决.总结如下
        首先楼上说得正确,我是用一个html页面作的测试,去访问我的程序的,html和程序不在一个根目录下.
        其次,这么多兄弟帮我解决看,竟然都忽视了我的Send是大写的,应改为小写
        再者,firefox不支持responseXML属性,我从服务器返回的xml流它不能解析,替换方案:在服务器生成一个xml字符串表达式,返回,适用DomParser方法解析成dom对象即可.
        最后,在客户端适用post方法提交一个dom流,会报错,说存在潜在危险的request.form值,好像有个内部验证,ie下正常,替换方案:适用get请求传递url参数.    如有错误请指正,谢谢大家的帮助.