function ajax_LookUpAcceptedCustomer(Email)
{
var resul = false;
var xhr=null;
// var myUrl = "http://localhost/LookUpAcceptedCustomer.php?ClientEmail=";
var myUrl = "http://localhost/LookUpAcceptedCustomer.php?";
// myUrl = myUrl + Email;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
xhr.onreadystatechange = function() {
if (LookUpAcceptedCustomer_Result(xhr))
{ resul = true;; }
else
{ resul = false;} };
xhr.open("POST", myUrl, true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send("ClientEmail="+Email);
// xhr.send(null);
alert(resul)
return resul;
}
function LookUpAcceptedCustomer_Result(xhr)
{
if(xhr.readyState == 4 && xhr.status == 200){
var docXML = xhr.responseXML;
var items = docXML.getElementsByTagName("RS")
if ( items.item(0).firstChild.data == 0 )
{
return false;
}
else
{
return true;
}
}
}
Partager