付上查询的代码function checkusername()
{
var userCheck=document.getElementById('reg_username').value;
//alert(userCheck);
var divcheck=document.getElementById('checknamediv');
var xmlhttp=initxmlhttp();
var url="usernamecheck.php?user_name="+userCheck;
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
divcheck.innerHTML=xmlhttp.responseText;
if(xmlhttp.responseText=="<font color=blue>The username is can be use.</font>")
{
document.form_register.reg_ok.disabled=false;
}
else
{
document.form_register.reg_ok.disabled=true;
}
}
if (xmlhttp.readyState==2)
{
divcheck.innerHTML="<font color=blue>Username checking, please wait...</font>";
}
}
xmlhttp.send(null);
}
{
var userCheck=document.getElementById('reg_username').value;
//alert(userCheck);
var divcheck=document.getElementById('checknamediv');
var xmlhttp=initxmlhttp();
var url="usernamecheck.php?user_name="+userCheck;
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
divcheck.innerHTML=xmlhttp.responseText;
if(xmlhttp.responseText=="<font color=blue>The username is can be use.</font>")
{
document.form_register.reg_ok.disabled=false;
}
else
{
document.form_register.reg_ok.disabled=true;
}
}
if (xmlhttp.readyState==2)
{
divcheck.innerHTML="<font color=blue>Username checking, please wait...</font>";
}
}
xmlhttp.send(null);
}
{
var userCheck=document.getElementById('reg_username').value;
//alert(userCheck);
var divcheck=document.getElementById('checknamediv');
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
var url="usernamecheck.php?user_name="+userCheck;
xmlhttp.open("GET",url,true);
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4 && xmlhttp.status==200)
{
divcheck.innerHTML=xmlhttp.responseText;
if(xmlhttp.responseText=="<font color=blue>The username is can be use.</font>")
{
document.form_register.reg_ok.disabled=false;
}
else
{
document.form_register.reg_ok.disabled=true;
}
}
if (xmlhttp.readyState==2)
{
divcheck.innerHTML="<font color=blue>Username checking, please wait...</font>";
}
}
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.send(null);
}
初始化下