var xmlHttpReq = false;
if(window.XMLHttpRequest){
xmlHttpReq = new XMLHttpRequest()
}else if(window.ActiveXObject){
xmlHttpReq =new ActiveXobject("Microsoft.XMLHTTP");
}
function docheck() {
if(xmlHttpReq){
var username = document.getElementById("username").value;
alert(username);
xmlHttpReq.onreadystatechange = onData;
xmlHttpReq.open("get", "serajax");
xmlHttpReq.send();
}
}
function onData(){
if(xmlHttpReq.status==200&&xmlHttpReq.readyState==4){
alert(xmlHttpReq.responseText);
document.getElementById("username1").value=xmlHttpReq.responseText;
}
}