xhr = new XMLHttpRequest();                     
xhr.open(
    "GET",                          
    "http://foo.com",       
    true                            
  );
xhr.onreadystatechange=function(){
    if (xhr.readyState==4){
      if (xhr.status==200){
        parseResponse(xhr);
      }else{
        //handle the HTTP error...
      }
    };
  };
xhr.send(null);