Display page
Function createxmlhttprequest () {If (window. activexobject) {XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");} else if (window. XMLHttpRequest) {XMLHTTP = new XMLHttpRequest () ;}// create the XMLHTTPRequest object createxmlhttprequest (); function callserver () {// obtain the data in the form var users = document. getelementbyid ("users "). value; // if it is not specified, if (users = NULL) | (users = "") return; // link webpage URL var url = "user_yes.aspx? User = "+ escape (users); // open the link XMLHTTP. open ("get", URL, true); // tells the server what to do after running (may take five or five hours). The updatepage function XMLHTTP is triggered here. onreadystatechange = updatepage; // send the request XMLHTTP. send (null);} // process the Server Response Function updatepage () {If (XMLHTTP. readystate = 4) {If (XMLHTTP. status = 200) {var response = XMLHTTP. responsetext; document. getelementbyid ("Onoff "). innerhtml = Response ;}}</SCRIPT>
Request page background
If (request ["user"]. tostring () = "admin") response. write ("& nbsp; <font color = Red> the user name already exists. Please change it </font>"); else response. write ("& nbsp; <font color = green> congratulations, you can use this user name </font>"); response. end ();