52,797
社区成员
发帖
与我相关
我的任务
分享
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
var xmlHttp=false;
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e2)
{
xmlHttp=false;
}
}
if(!xmlHttp && XMLHttpRequest!='undefined')
{
xmlHttp=new XMLHttpRequest();
}
function getUserInfo()
{
var num=document.getElementById("numText").value;
xmlHttp.onreadystatechange=update;
xmlHttp.open("get","Receive.aspx?num="+num,true);
xmlHttp.send(null);
}
function update()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert("Server is done");
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server" action="post">
<div>
<p><input type="text" id="numText" onchange="getUserInfo()" /></p>
</div>
</form>
</body>
function getUserInfo()
{
var num=document.getElementById("numText").value;
xmlHttp.onreadystatechange=update;
xmlHttp.open("get","Receive.aspx?num="+num,true);
xmlHttp.send(null);
}
function update()
{
if(xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert("Server is done"+xmlHttp.responseText);
}
}
}