日期:2014-05-18  浏览次数:20718 次

来人吧啊啊啊啊啊啊啊
js(在success5,jsp中):
<script type="text/javascript">
        var xmlHttp;
        var flag;
         
        function createXMLHttp(){
            if(window.XMLHttpRequest){
                xmlHttp = new XMLHttpRequest();
            }else{
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
        }
         
        function checkUserId(Aname){
            createXMLHttp();
            
       
      xmlHttp.open("post", "CheckRegAction?Aname="+Aname,true);
      xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            xmlHttp.onreadystatechange = checkUserIdCallback;
            xmlHttp.send(Aname);
            
        }
         
        function checkUserIdCallback(){
            if(xmlHttp.readyState == 4){
                if(xmlHttp.status == 200){
                    var text = xmlHttp.responseText;
                    if(text == "true"){
                        flag = false;
                        document.getElementById("msg").innerHTML = "用户ID已存在";
                    }else{
                        flag = true;
                        document.getElementById("msg").innerHTML = "用户ID可添加";
                    }
                }
            }
   &nbs