[Original] Tutorial 2 on implementing the user registration function using ajax. [Original] ajax implementation of user registration function tutorial 2, this tutorial by the site original, reproduced please indicate the author: www.drise.cn mailbox: drise@163.comQQ: 271728967 above the first reg. php [original] ajax implementation user registration function tutorial 2 ','
//
This tutorial is original on this site.
Author: www.drise.cn
Email: drise@163.com
QQ: 271728967
//
The first reg. php file above has been completed, so I will do the second step.
Var xmlHttp = false;
Function ajaxcreate () {// Here is the creation of the xmlhttpt object
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 () {// The operation to be performed after the reg. php onblur () event is received,
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 ("pxm"). innerHTML ="
Verifying. please wait...
";
}
If (xmlHttp. readyState = 4 ){
Document. getElementById ("pxm"). innerHTML = xmlHttp. responseText;
}
}
Login to achieve user registration function tutorial 2 ',' // This tutorial by the site original, reproduced please indicate to the author: www.drise.cn mailbox: drise@163.com QQ: 271728967 // above the first reg. php...