Up until now I have been using:
xmlhttp.open(\"GET\",\"server_script.php?q=\"+str,true);
Thanks
Edit: I am providing a solution for an
this is how you would use post:
var url = "server_script.php";
var params = "q="+str;
xmlhttp.open("POST", url, true);
//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.onreadystatechange = function() {//Call a function when the state changes.
if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
alert(xmlhttp.responseText);
}
}
xmlhttp.send(params);
source