付上查询的代码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);
}

解决方案 »

  1.   

    function checkusername()
    {
    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);
    }
      

  2.   

    var xmlhttp = false;
    初始化下
      

  3.   

    no, the cache make this.if you want deal this. you shouldn't use open method's first parameter as "GET"//open("GET",url,true or false)    this will make the IE browser cache itso you should change it into thisopen("POST",url,true or false)that's allif you still have problems, send mail to me: [email protected]
      

  4.   

    usernamecheck.php最前面加上header("Cache-Control: no-cache, must-revalidate");