还是以前提出来了的一个问题:在IE里是好的,在谷歌里没有数据显示。 
           
        function callServer() 
        {
                  
           var url = "PageName.aspx?Id=" + escape("zx");
           
          xmlHttp.open("POST", url, true);
          xmlHttp.onreadystatechange = updatePage;
          xmlHttp.send(null);  
// xmlHttp.onreadystatechange=updatePage;
          // xmlHttp.open('POST',url,true);
            // xmlHttp.setRequestHeader('Content-Length',args.data.length);//post提交是要加这两行,好像上面这一行可以省略,
            // xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
            // xmlHttp.send("Id=" + escape("zx"));//post提交时参数要放在这里        }
         if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
        {
           xmlHttp = new XMLHttpRequest();
        }
        function updatePage() 
        {
               if (xmlHttp.readyState == 4) {
                                    var response = xmlHttp.responseText;  
                    // test1.innerHTML=response;              
                    //alert(response);
                   document.getElementById('test1').innerHTML=response;
                    
               }
        }这是显示的:
<div><span style="padding:0 2px 0 2px; font-size:10pt; font-weight:bolder;" id="test1" class="xiahuaxian"> </span></div>

解决方案 »

  1.   

    xmlHttp.setRequestHeader("Connection", "close");if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
    ...
      

  2.   


              谢谢楼上的回复呀?可是我改成这样后: 在IE里也不出来了,能不能帮忙在看看呀,谢谢
      
       function callServer() 
            {
                      
               var url = "PageName.aspx?Id=" + escape("zx");
               
              xmlHttp.open("POST", url, true);
              xmlHttp.onreadystatechange = updatePage;
              xmlHttp.send(null);  
    // xmlHttp.onreadystatechange=updatePage;
              // xmlHttp.open('POST',url,true);
                // xmlHttp.setRequestHeader('Content-Length',args.data.length);//post提交是要加这两行,好像上面这一行可以省略,
                // xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
                // xmlHttp.send("Id=" + escape("zx"));//post提交时参数要放在这里        }
             if (!xmlHttp && typeof XMLHttpRequest != 'undefined') 
            {
               xmlHttp = new XMLHttpRequest();
            }
            function updatePage() 
            {
            xmlHttp.setRequestHeader("Connection", "close");              //  if (xmlHttp.readyState == 4) 
                 if(xmlHttp.readyState == 4 && xmlHttp.status == 200)
                   {
                                        var response = xmlHttp.responseText;  
                        // test1.innerHTML=response;              
                        //alert(response);
                       document.getElementById('test1').innerHTML=response;
                        
                   }
            }
      

  3.   


    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Connection", "close"); 
    xmlHttp.onreadystatechange = updatePage;
    xmlHttp.send(null);  
      

  4.   

    另外,
    var url = "PageName.aspx?Id=" + escape("zx");
    你是GET方法请求,无需POST