An error occurred while returning data from the AJAX server. onreadystatechange cannot trigger the callback function.
Source: Internet
Author: User
An error occurred while returning data from the AJAX server. onreadystatechange cannot trigger the callback function and input an email in a text tag. when onblur triggers the verification event and checks whether the user exists in the database, the dispear method is used to trigger an onblur event. If the server has received the locally sent data and the verification is successful, the AJAX server fails to send the data back. onreadystatechange cannot trigger the callback function.
Enter an email in a text tag. when onblur triggers the verification event, go to the database to check whether the user already exists. the dispear method is the onblur event trigger method. The verification server has received the data sent locally and the verification is successful, but the echo does not return.
The js code is as follows:
Var myXmlHttpRequest;
Function getXmlHttpObject (){
Var xmlHttpRequest;
Try {
XmlHttpRequest = new XMLHttpRequest ();
}
Catch (e ){
Try {
XmlHttpRequest = new ActiveXObject ("Msxml2.HMLHTTP ");
}
Catch (e ){
XmlHttpRequest = new ActiveXObject ("Microsoft. XMLHTTP ");
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 ");
// Specify the callback function
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.