62,250
社区成员




<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>无标题页</title>
<script type="text/javascript">
var xmlHttp;
function createXMLHTTP()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
xmlHttp= new XMLHttpRequest();
}
}
function checkUserName()
{
if(xmlHttp.readyState==4)//判断对象状态
{
if(xmlHttp.status==200)//信息成功返回,开始处理信息
{
if(xmlHttp.responseText=="false")
{
document.getElementById("checkImg").src="images/false.jpg";
}
else
{
document.getElementById("checkImg").src="images/true.jpg";
}
}
}
}
function CheckName(var name)
{
createXMLHTTP();
var url="2.aspx?name="+name;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=checkUserName;
xmlHttp.send(null);
}
</script>
</head>
<body style="text-align: center">
<form id="form1" runat="server">
<div>
<table style="width: 338px; text-align: center">
<tr>
<td style="width: 100px">
用户:</td>
<td style="width: 113px">
<input id="userName" type="text" onkeyup="CheckName(document.getElementById('userName').value);" /></td>
<td style="width: 113px">
<img id="checkImg" src="" /></td>
</tr>
<tr>
<td style="width: 100px">
密码:</td>
<td style="width: 113px">
<input id="userPwd" type="text" /></td>
<td style="width: 113px">
<img src="" id=""/></td>
</tr>
</table>
<br />
</div>
</form>
</body>
</html>
//function CheckName(var name)
//改为
function CheckName(name)
{
createXMLHTTP();
var url="2.aspx?name="+name;
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=checkUserName;
xmlHttp.send(null);
...........