var xmlHttp;
function createXHR(){
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
if (!xmlHttp) {
alert('您使用的瀏覽器不支援 XMLHTTP 物件');
return false;
}
}
function sendRequest(id){
createXHR();
var url='045-checkID.php?ID='+id+'&timeStamp='+new Date().getTime();
window.status='Checking customer ID...';
xmlHttp.open('GET',url,true);
xmlHttp.onreadystatechange=catchResult;
//xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.send(null);
}
function catchResult(){
if (xmlHttp.readyState==4){
s=xmlHttp.responseText;
if (xmlHttp.status == 200) {
if (s=='true'){
document.getElementById('chkr').innerHTML='已经使用';
}else{
document.getElementById('chkr').innerHTML='可用';
}
}
}
}