title: XMLHTTPRequest returns null in response
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/8022425/getting-blob-data-from-xhr-request">Getting BLOB data from XHR request</a>  </p>
  </blockquote>
  
  
  
  <p>I try to get an image from my server dynamically, but the XMLHTTPRequest returns null in the response. The Google Chrome network tool tells me that he loaded the day1.jpg, but the blob variable is null...</p>
  
  <pre><code>var xhr = new XMLHttpRequest(), blob;
  
  xhr.open("GET", "day1.jpg", true);
  
  // Set the responseType to blob
  xhr.responseType = "blob";
  
  xhr.addEventListener("load", function () {
      if (xhr.status === 200) {
          console.log("Image retrieved");
          blob = xhr.response;
          console.log("blob: " + blob);
      }
  }, false);
  
  // Send XHR
  xhr.send();
  </code></pre>
  
  <p>The output is:</p>
  
  <pre><code>Image retrieved
  blob: null
  </code></pre>