The XMLHTTP of Ajax

Source: Internet
Author: User
Tags exit end return window
Ajax|xml

<script type= "Text/javascript" language= "JavaScript" >
<!--
Fetching data in XML
function Xmlpost (theemail)
{
var webfileurl = ". /user/checkuser.aspx? Logonname= "+ theemail;
var result = "";

if (window. ActiveXObject) {
XmlHttp = new ActiveXObject ("Microsoft.XMLHTTP");
}
else if (window. XMLHttpRequest) {
XmlHttp = new XMLHttpRequest ();
}

var xmlHttp = new ActiveXObject ("MSXML2. XMLHTTP ");
Xmlhttp.open ("POST", Webfileurl, false);
Xmlhttp.setrequestheader ("Content-type", "application/x-www-form-urlencoded");
Xmlhttp.send ("");

Xmlhttp.onreadystatechange=function ()
{
if (xmlhttp.readystate==4)
{
result = Xmlhttp.responsetext;
}
}
if (xmlhttp.status!=200)
{
Alert (' Network failure (xmlhttp.status= ' +xmlhttp.status+ '), please try again later! ');
}

result = Xmlhttp.responsetext;
result = Result.substring (0,result.indexof) ("? EX "));

If (Result!= "false")
{
return true;
}
Else
{
return false;
}
}
-->
</script> "' <summary>
"" Detects if the user exists < filename:. /user/checkuser.aspx>
"' </summary>
"' <remarks>created by Dzh @2006/06/27 18:22</remarks>
Partial Class Web_user_checkuser
Inherits System.Web.UI.Page

    Protected Sub Page_Load (ByVal sender as Object, ByVal e as System.EventArgs) Handles me.load
&nbs p;       If request.querystring ("LogonName") is nothing Then
             Response.Write ("False +"?) EX ")
            response.end ()
             Exit Sub
        End If

If (New EasyClick.EasyBusiness.UserBusiness). Getuserbylogonname (Request.QueryString ("LogonName"). ToString) is nothing Then
Response.Write ("False +"?) EX ")
Response.End ()
Exit Sub
Else
Response.Write ("True +"?) EX ")
Response.End ()
Exit Sub
End If
End Sub
End Class



Related Article

Cloud Intelligence Leading the Digital Future

Alibaba Cloud ACtivate Online Conference, Nov. 20th & 21st, 2019 (UTC+08)

Register Now >

Starter Package

SSD Cloud server and data transfer for only $2.50 a month

Get Started >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

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.