What is xmlHttpRequest in javascript ajax ?
XMLHttpRequest (XHR) objects are used to interact with servers. It will retrieve data from a URL without having to do a full page refresh. This enables a Web page to update just part of a page without disrupting what is going on already. XMLHttpRequest is used heavily in AJAX programming.
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("txtHint").innerHTML = this.responseText;
}
};
xmlhttp.open("GET","getuser.php?q="+str,true);
xmlhttp.send();