in effetti ho sbagliato a copiare!
function createRequestObject(){

var req;

if(window.XMLHttpRequest){
//For Firefox, Safari, Opera
req = new XMLHttpRequest();
}
else if(window.ActiveXObject){
//For IE 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
//Error for an old browser
alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
}

return req;
}

//Make the XMLHttpRequest Object
var http = createRequestObject();

function sendRequest(url,nomediv) {
http.open('GET',url,true);
http.onreadystatechange = function() {handleResponse(nomediv);};
http.send(null);
}

function handleResponse(nomediv){
if (http.readyState == 4) {
if (http.status == 200) {
document.getElementById(nomediv).style.display='bl ock';
document.getElementById(nomediv).innerHTML=http.re sponseText;
}
else {
document.getElementById(nomediv).style.display='bl ock';
document.getElementById(nomediv).innerHTML="ERRORE "+http.status;
}
}
}