var http_req = new XMLHttpRequest();
var url = "myscript.php";
var params = "myparam=myparamvalue";
var displaybox = document.getElementById("display").innerHTML;
displaybox ="<h3>Loading data ...</h3>";
http_req.onreadystatechange=function() {
if (http_req.readyState==4 && http_req.status==200) {
displaybox = http_req.responseText;
}
}
http_req.open("POST",url,true);
http_req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_req.send(params);
var http_req = new XMLHttpRequest();
var url = "index.php";
var formdata = new FormData(document.getElementById("texform"));
document.getElementById("display").innerHTML="<h3>Loading data ...</h3>";
http_req.onreadystatechange=function() {
if (http_req.readyState==4 && http_req.status==200) {
document.getElementById("display").innerHTML=http_req.responseText;
}
}
http_req.open("POST",url,true);
http_req.send(formdata);