现在我们把check.js文件代码来看看吧.
function c(){
var uid =document.getElementById('uid').value;
var pwd =document.getElementById('password').value;
var pwd2=document.getElementById('password2').value;
var mo =document.getElementById('mo').value;
var name=document.getElementById('name').value;
if( uid=='' || uid.length>12 || uid.length
document.getElementById('u_info').innerHTML='
}
var xmlHttp = false;
function ajaxcreate(){
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}
if(!xmlHttp){alert('Create Xmlhttp Fail ');return false;}
}
function ajax(){
ajaxcreate();
var xmvalue=document.getElementById("uid").value;
var url="ajax_check.php?txt="+encodeURI(xmvalue);
if (xmvalue== null || xmvalue.length>20 || xmvalue == "") return false;
xmlHttp.open("POST",url,true);
xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlHttp.send(xmvalue);
xmlHttp.onreadystatechange=returnstate;
}
function returnstate(){
if(xmlHttp.readyState != 4 ){
document.getElementById("u_info").innerHTML="