一个简单的AJAX问题 在提交评论的时候,怎么显示提交的评论呢?if(xmlHttp.readyState == 4){ if(xmlHttp.status == 200){这个里面应该怎么写呢?}} 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 alert("The server replied with: " + xmlHttp.responseText); 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); 返回的不是我想要的 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> 表示服务器处理正常,现在需要你将返回的结果xmlHttp给表现出来.主要看你所要如何表现 请问那个content是什么?innerHTML --> Error:未知的运行时错误 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){//} 要几个页面搞定呢我一个提交的页面 在提交页面有个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);处理提交来的数据 入数据库现在在提交页面怎么可以看到提交出现的内容呢?或者是我的思路一开始就错了 请教大家 C#写的winform程序开启10分钟左右就会卡死 c#连接sql数据库错误 :在没有任何数据时进行无效的读取尝试 C#初学者问:QQ游戏中的斗地主中的“托管”与C#中的“托管”有没有什么联系?? 在winform编程中,如何将一个excel表中的图片复制到另一个excel表中去 一个正则表达式 编程时打字问题 从oracle序列中取值插入数据库的问题, 急!!!!!!! 获取当前url的问题 c#编译游戏,随机移动的敌人怎么编译 sql的问题 请问各位 用VS2005 作的 C#小游戏 怎样打包 才能在其他没装VS 的电脑上玩? JS高手进来看看,谢谢
xmlHttp.onreadystatechange = function (){
if(xmlHttp.readyState == 4){
if(xmlHttp.status == 200){我那个A.aspx是处理提交到数据库的页面
alert("The server replied with: " + xmlHttp.responseText); 返回的不是我想要的
Response.Write(content);
Response.End();html:
if(xmlHttp.readyState == 4){
if(xmlHttp.status == 200){
document.getElementById("div1").innerHTML=xmlHttp.responseText;
}}<div id="div1"></div>
innerHTML --> Error:未知的运行时错误
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)
{
//
}
我一个提交的页面 在提交页面有个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);处理提交来的数据 入数据库
现在在提交页面怎么可以看到提交出现的内容呢?
或者是我的思路一开始就错了 请教大家