下边是请求的jquery代码 下边这个代码在IE8中可以使用,但在firefox中却无返回值!! $.get("/Manage/user.aspx?asyn=1" ,function(data,status){
                if (data!="")
                {
                    parent.document.getElementById('Lb_msgnum').innerHTML =  data; // xmlhttp.responseText;
                }
                alert(data);  //这句是空值 data.length为0
                alert(status);//显示 成功
          },"text")
user.aspx中的代码     //ajax异步刷新消息数量
                if (!string.IsNullOrEmpty(Request.QueryString["asyn"]))
                {                    Response.ContentType = "application/text";
                    Response.Write(Lb_msgnum.Text);
                    Response.End();
                }

解决方案 »

  1.   

     if (data!="")
                    {
                        parent.document.getElementById('Lb_msgnum').innerHTML =  data; // xmlhttp.responseText;
    alert( parent.document.getElementById('Lb_msgnum').innerHTML );//看看在FF能不能显示出值。
                    }
    //Response.ContentType = "application/text";
                        Response.Write(Lb_msgnum.Text);
      //Response.End();
    注释掉试试
      

  2.   

    firebug是查不出问题来的!
      

  3.   

    调试。应该可以的 jQuery很不错的 大多数浏览器都可以。
      

  4.   

    firebug调试出来的结果如下
    GET http://localhost:91/Manage/user.aspx?asyn=1  这后面有个红叉,请求到的页面出的错。。但在IE却又是可以执行的,是字符编码还是我在user.aspx 下代码出的问题!!
                    if (!string.IsNullOrEmpty(Request.QueryString["asyn"]))
                    {
                        Response.ContentType = "application/text";
                        Response.Write(Lb_msgnum.Text);
                        Response.End();
                    }

    jquery....min.js (line 130)
    ParamsHeadersPostPutResponseCacheHTMLasyn 1  这是parmar的值
    下面是Headers的值
    Response Headersview source
    Request Headersview source
    Host localhost:91
    User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
    Accept text/plain, */*
    Accept-Language en-us,en;q=0.5
    Accept-Encoding gzip,deflate
    Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive 115
    Connection keep-alive
    X-Requested-With XMLHttpRequest
    Referer http://localhost:91/Manage/FriendManage/FriendMsgList.aspx
    Cookie ASP.NET_SessionId=z2girh45ue5m3s553g5gqc55
    //
    response的值为 空
      

  5.   

     Response.ContentType = "application/text";
     Response.Write(Lb_msgnum.Text);
     Response.End();
    Lb_msgnum.Text 这个是一个服务器控件?你换成一个常量试试!ajax 后台处理是获取不到视图状态的!
      

  6.   

    变成常量也是一样。
    我还发现在firefox中status为0,在IE就是200这是什么原因啊。
      

  7.   

    我又用debug跟了一下,发现在firefox中是提交不到user.aspx中,也就是说下面的赋值没有被执行到,
     Response.Write(Lb_msgnum.Text);
     Response.End();
    我想这也就是为什么responseText返回为空字符串的原因了吧,但是很奇怪IE中就没有这样!!
      

  8.   

    你在firefox里面输入 http://localhost:91/Manage/user.aspx?asyn=1 能直接访问到吗
      

  9.   

    呵呵,肯定是那块的兼容问题.又用firebug直接就在请求的页面打了个红叉,说是jquery第5252行代码如下
     xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null ); 这个我真不知道是什么意思!!IE下就能用,而且我用得是fromvaidation的框架在这里用ajax也是可行的。自己写的jquery反倒是不行了!!
      

  10.   

    是不是用IE8的时候登陆了,用FF的时候忘了登陆
      

  11.   

    输出类型错误,应该是:Response.ContentType = "text/plain";
      

  12.   

    换了种方式,不用ajax无奈结了