sapete dirmi se in questa funzione c'e' un errore?
Non capisco come mai in pagina uso una funzione quasi uguale e funziona perfettamente, forse è uhn errore stupido che non riesco a trovare

Codice PHP:
var xmlhttp;

function 
CreateXMLhttpRequest()
{
    if (
window.ActiveXObject)
    {
        
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (
window.XMLHttpRequest)
    {
        
xmlHttp = new XMLHttpRequest();
    }
}

//aggiungi al canale
function StartRequest2(ajax_url)
{
    
CreateXMLhttpRequest();
    
xmlHttp.onreadystatechange= function() {
      if(
ajax.readyState === 4) {
      if(
ajax.status == 200)
        
alert("Operazione effettuata con successo");
      else
        
alert("Operazione fallita, errore numero " ajax.status);
      }
    }
    
xmlHttp.open("GET",ajax_url,true); 
    
xmlHttp.send(null);

Grazie

Giuseppe