我页面后台程序还没处理完,我就Response.Flush();提前返回一部数据,用ajax技术咋获得呢?他的回调函数咋写?
解决方案 »
- .net上传服务器后的问题
- 50分求助:导航栏的下拉菜单从数据库里面读应该怎么办????
- 一点小问题
- 应用MasterPage后,怎么在content或者masterpage中用Jscript使用form名引用Content中的控件?
- 关于查询语句的问题
- owc的问题,寻求高手解答
- GIF透明输出的问题!
- 【求助】w3wp.exe发生错误怎么解决
- <%@ Page language="c#" Codebehind="AddBook.aspx.cs" AutoEventWireup="false" Inherits="BookShop.AddBook" %>
- 入门问题,请帮助
- request.form["name"]值为null
- .net frameset 4.0 的版本改为2.0的版本后AJAX控件出了问题怎么办
type: "POST",
url: "some.php",
data: "name=John&location=Boston",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
//这里写操作
})
.......
函数xxx('返回内容');
函数xxx('返回内容');
函数xxx('返回内容');
Response.End();前台ajax的success的function(msg)
alert(msg)就可以弹出s
因为默认情况下,只有当xmlhttprequest数据获取并解析完毕时才会执行
自己写一个也挺简单的function ajaxLoad(url, onsuccss, onerror) {
if (window.ActiveXObject) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } }
else if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest();}
if (xmlhttp == null) { alert("浏览器不支持XMLHttpRequest,无法动态加载内容!"); return true; }
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4) if (xmlhttp.status == 200) onsuccss(xmlhttp.responseText); else onerror();
}
xmlhttp.send();
return false; //屏蔽url的点击
}
要在解析完毕之前就处理数据,可试着修改上面的为3(正在交互,但未完成解析)