Obviously to talk to a server you would have to first send a request to the server, then recieve the response. However it appears in this code that you first recieve the response then in the next line send the request -- what is going on here?
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","gethint.php?q="+str,true);
xmlhttp.send();