标题:求助!AJAX用户注册验证问题
只看楼主
初心者1号
Rank: 1
等 级:新手上路
帖 子:42
专家分:0
注 册:2007-3-31
 问题点数:0 回复次数:2 
求助!AJAX用户注册验证问题

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>register Page</title>
<style type="text/css">
h1{
font-size : 150%;
font-family : Showcard Gothic;
color : #ff6c01;
}
table{
width : 80%;
border : 1px solid #b5b5b5;
background : #ff;
}
table td{
margin : 0 ;
padding : 8px 20px;
text-align : center;
}
table td.title{
margin : 0 ;
padding : 8px 20px;
text-align : right;
font-size : small;
background : #FFCCA6;
}
table td.remark{
margin : 0;
font-size : small;
text-align : left;
}
</style>
<script language="javascript">
var httpRequest = false;
function createRequest(){
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
httpRequest = false;
}
}

if (!httpRequest && typeof XMLHttpRequest != 'undefined') {
httpRequest = new XMLHttpRequest();
}
}
function getBackInfo(){
var username = document.getElememtById("username").value;
var url='checkUser.jsp?username='+username;
httpRequest.open("GET",url,"true");
httpRequest.onreadystatechange=disResult;//隐性的循环
httpRequest.send(null);
}
function disResult(){
if(httpRequest.readystate == 4){
if(httpRequest.status == 200){
//一切都OK了,那就该用Javascript去执行你想要的动作了
document.getElememtById("disCheckResult").value=request.responseText;
alert("done");
}
else{
alert("Something Wrong has Happend!");
}
}
}
</script>
</head>
<body>
<h1>①Step.name</h1>
<form action="" method="post" name="rf">
<table align="center" cellspacing="0">
<tr>
<td width="20%" class="title">name:</td>
<td width="30%"><input type="text" id="username" name="uname" maxlength="20" onblur="getBackInfo()"></td>
<td width="50%" class="remark" ><dd id="disCheckResult"></dd></td>
</tr>
</table>
</form>

</body>
</html>
说我的那一行有问题,但是不知道怎么改,请各位大哥帮我改改,谢谢!

搜索更多相关主题的帖子: AJAX target blank href 
2007-09-15 14:27
superzhaoxi
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-10-25
得分:0 
getElememtById你写错了,
2007-09-18 16:46
superzhaoxi
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2006-10-25
得分:0 
应该是getElementById
2007-09-18 16:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-170151-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016300 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved