[Original]ajax Realization User Registration Function Tutorial two ', '
//
This tutorial by the original site, reproduced please specify to place
Author: www.drise.cn
E-mail: drise@163.com
qq:271728967
//
The first reg.php file above has been done, and I'll take the second step.
var xmlHttp = false;
function Ajaxcreate () {//Here is the creation of XMLHTTPT on the image
try {
XmlHttp = new ActiveXObject ("Msxml2.xmlhttp");
} catch (e) {
try {
XmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
} catch (E2) {
XmlHttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest! = \\\ ' undefined\\\ ') {
XmlHttp = new XMLHttpRequest ();
}
if (!xmlhttp) {alert (\\\ ' Create xmlHttp Fail \\\ '); return false;}
}
function Ajax () {//Here is the action to take after receiving the reg.php onblur () event,
Ajaxcreate ();
var Xmvalue=document.getelementbyid ("XM"). Value;
var url= "/boke/blog/type.php?txt=" +encodeuri (Xmvalue);
if (xmvalue== null | | xmvalue.length>20 | | xmvalue = = "") return false;
Xmlhttp.open ("POST", url,true);
Xmlhttp.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Xmlhttp.send (Xmvalue);
Xmlhttp.onreadystatechange=returnstate;
}
function Returnstate () {
if (xmlhttp.readystate! = 4) {
document.getElementById ("Divxm"). Innerhtml= "In validation, please later ...";
}
if (xmlhttp.readystate = = 4) {
document.getElementById ("Divxm"). Innerhtml=xmlhttp.responsetext;
}
}
http://www.bkjia.com/PHPjc/629575.html www.bkjia.com true http://www.bkjia.com/PHPjc/629575.html techarticle [Original]ajax realize user Registration function tutorial Two ', '///This tutorial by the original site, reproduced please indicate the author: www.drise.cn e-mail: drise@163.com qq:271728967//above the first reg.php text ...