AJAX Server loopback data failed onreadystatechange cannot trigger callback function
Source: Internet
Author: User
AJAX Server loopback data failed onreadystatechange cannot trigger callback function
Enter an e-mail message in a text label that triggers a validation event when onblur, to the database to verify that the user already exists, where the Dispear method is the method that is triggered by the onblur event. Verified the server has received the data sent locally and verified the success, but Echo does not go back.
The JS code is as follows:
var myxmlhttprequest;
function Getxmlhttpobject () {
var XMLHttpRequest;
try{
Xmlhttprequest=new XMLHttpRequest ();
Myxmlhttprequest=getxmlhttpobject ();
if (myxmlhttprequest) {
Alert ("Hello" +email);
var url= "/renren/register_legal_process.php";
var data= "email=" +email;
Myxmlhttprequest.open ("Post", url,true);
Myxmlhttprequest.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Specifying a callback function
}
function $ (ID) {
return document.getElementById (ID);
}
function disappear (REF1,REF2,REF3,REF4) {
var app=$ (REF1);
var tmp1=$ (REF2);
var tmp2=$ (REF3);
var tmp3=$ (REF4);
var Str=tmp1.value;
var reg=/^ ([a-za-z0-9]+[_|\-|\.]?) *[a-za-z0-9]+@ ([a-za-z0-9]+[_|\-|\.]?) *[a-za-z0-9]+\. [A-za-z] {2,3}$/gi;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.