怎样加一个请求超时!!
ar reajax;try {
reajax = new XMLHttpRequest();
} catch (trymicrosoft) {
try {
reajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (othermicrosoft) {
try {
reajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
reajax = false;
}
}
}
if (!reajax)
alert(" XMLHttpreajax!创建失败 ");
function pageloading(page)
{
var Rand = Math.random();
reajax.open("GET","X_M_L/getList.ashx?page="+page+"&r="+Rand+"",true);
reajax.onreadystatechange = update;
reajax.send(null);
}
function update()
{
if (reajax.readyState == 4)
{
if (reajax.status == 200)//請求完成
{
var va = reajax.responseText;
if(va==1)
{
alert("ok");
}
}
}
}
补充:.NET技术 , ASP.NET