62,268
社区成员
发帖
与我相关
我的任务
分享
function sendData() {
var xmlHttp;
if (window.ActiveXObject) //是否支持ActiveX控件
{
//支持ie为构造函数输入参数Microsoft.XMLHTTP,创建一个XMLHttpRequest
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
//ActiveXObject创建失败,非ie
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
else {
window.alert("该浏览器不支持AJAX,请更换浏览器");
}
if (xmlHttp != null) {//对象实例化成功 开始干活0.0
var CurrPage = document.getElementById("lblCurrPage").innerHTML;
xmlHttp.open("get", "AjaxLoginEmps.aspx?CurrPage=" + CurrPage + "&p=" + Math.random(), true);
//调用open()方法并采用异步方式
xmlHttp.onreadystatechange = function() {
alert(xmlHttp.readyState);
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
//doing...
}
else {
}
}
xmlHttp.send(null);
}
}
xmlHttp.open("get", "AjaxLoginEmps.aspx?CurrPage=" + CurrPage + "&p=" + Math.random(), true);
xmlHttp.send();