我可以在注册时检测,但现在不都单拿出来检测吗?怎么办

解决方案 »

  1.   

    下面是我用的:
    [<a style="CURSOR: hand; "  onclick="javascript:Form_Submit(Form1);" >检测名称</a>]&nbsp;&nbsp;<span id="InfoSpan" align="left" class="security-op-error"></span>function Form_Submit(theForm)
    {
        var name = theForm.name.value;//得到名称
        //generate the requrl
        var requrl = "judge.jsp?name=" + encodeURI(name);
        xmlHttp.open("POST",requrl, true);    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        xmlHttp.onreadystatechange = updateInfoDiv;
        xmlHttp.send();  return false;
    }function updateInfoDiv(){
      if (xmlHttp.readyState == 4) {
        var retXml = xmlHttp.responseText;    var resspan = document.getElementById("InfoSpan");    resspan.innerText = retXml;
      }
    }