在提交评论的时候,怎么显示提交的评论呢?
if(xmlHttp.readyState == 4){
        if(xmlHttp.status == 200){
这个里面应该怎么写呢?
}}

解决方案 »

  1.   

    alert("The server replied with: " + xmlHttp.responseText);
      

  2.   

     xmlHttp.open("POST","A.aspx",true);
            xmlHttp.onreadystatechange = function (){
            if(xmlHttp.readyState == 4){
            if(xmlHttp.status == 200){我那个A.aspx是处理提交到数据库的页面
    alert("The server replied with: " + xmlHttp.responseText); 返回的不是我想要的
      

  3.   

    c#
    Response.Write(content);
    Response.End();html:
    if(xmlHttp.readyState == 4){ 
            if(xmlHttp.status == 200){ 
            document.getElementById("div1").innerHTML=xmlHttp.responseText;
    }}<div id="div1"></div>
      

  4.   

    表示服务器处理正常,现在需要你将返回的结果xmlHttp给表现出来.主要看你所要如何表现
      

  5.   

    请问那个content是什么?
    innerHTML -->  Error:未知的运行时错误
      

  6.   

    var url = "";

    CreateXMLHttpRequest();
    xmlHttp.open("get",url);
    xmlHttp.onreadystatechange = GetXMLResult;
    xmlHttp.send(null);
    //接收ajax返回数据,接收完成后显示选择框
    function GetXMLResult()
    {
    if(xmlHttp.readyState == 4)
    {
    if(xmlHttp.status == 200)
    {
    GetContentAndPageCount(xmlHttp.responseText);
    }
    }
    else
    {
    $(DivID).innerHTML = "正在读取数据中...";
    $(DivID).innerHTML += SetIframeWidthAndHeight($(DivID).clientWidth,$(DivID).clientHeight);
    }
    }
    function GetContentAndPageCount(resTxt)
    {
    //
    }
      

  7.   

    要几个页面搞定呢
    我一个提交的页面  在提交页面有个function show(){   
                            createXMLHttpRequest();
                            xmlHttp.open("GET","SHOW.aspx",false);
                            xmlHttp.send(null);   
                            document.write(xmlHttp.responseText);   
                            }show();  其中SHOW.aspx 显示评论列表的
    一个 xmlHttp.open("POST","A.aspx",true);处理提交来的数据 入数据库
    现在在提交页面怎么可以看到提交出现的内容呢?
    或者是我的思路一开始就错了 请教大家