<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<TITLE>JS AJAX User Registration authentication Code </title>
<script>
ajax///////
function CreateObject () {
var xmlhttp;
try{
Xmlhttp=new ActiveXObject ("Microsoft.XMLHTTP");
}
catch (e) {
try{
Xmlhttp=new XMLHttpRequest ();
}
catch (e) {
Xmlhttp=false;
}
}
return XMLHTTP;
}
function Getwebselect2 () {
var xmlhttp=createobject ();
if (XMLHTTP) {
var Nameid=document.getelementbyid (' user_name '). Value;
Xmlhttp.open (' Get ', ' regcs.asp tutorial? name= ' +nameid+ ' &n= ' +math.random (), true);
Xmlhttp.onreadystatechange=function () {
if (xmlhttp.readystate==4 && xmlhttp.status==200) {
Content=unescape (Xmlhttp.responsetext);
alert (content);
Weekday.innerhtml=content;
return content;
document.getElementById (' Tidd '). value=content;
if (content==1) {
Uname.innerhtml= ' The user name has been registered! ';
return false;
}
else{
Uname.innerhtml= ' ';
}
}
else{
Content.innerhtml= ' data is loading ... ';
}
return true;
}
Xmlhttp.send (NULL);
}
}
function Getwebselect3 () {
var xmlhttp=createobject ();
if (XMLHTTP) {
var User_code=document.getelementbyid (' User_code '). Value;
Xmlhttp.open (' Get ', ' regcs.asp?code= ' +user_code+ ' &n= ' +math.random (), true);
Xmlhttp.onreadystatechange=function () {
if (xmlhttp.readystate==4 && xmlhttp.status==200) {
Content=unescape (Xmlhttp.responsetext);
alert (content);
Weekday.innerhtml=content;
return content;
document.getElementById (' Tidd2 '). value=content;
if (content==1) {
Code2.innerhtml= ' Validation code input Error! ';
return false;
}
else{
Code2.innerhtml= ' ';
}
}
else{
Content.innerhtml= ' data is loading ... ';
}
return true;
}
Xmlhttp.send (NULL);
}
}
</script>
<body>
<tr>
<TD width= "align=" "Right" class= "Reg-item" ><span class= "color" >*</span> user name:</td>
<TD width= "261" valign= "Middle" ><input name= "user_name" type= "text" class= "input_out" id= "user_name" onfocus = "Onfuos (' user_name ')" Onblur= "Reg ()" onmousemove= "This.classname= ' Input_move '" "Onmouseo tutorial ut=" This.classname= " Input_out ' "style=" width:250px; "/>
<label>
<input name= "Tidd" type= "hidden" id= "Tidd"/>
</label>
<label></label>
</td>
<TD width= "527" valign= "Middle" ><span id= "uname" ></span></td>
</tr>
</body>