title: how can I get the return status code when using iframe.src to download a file?
body: <p>Here is the <code>downloadURL</code> function which I'm using to download a file:</p>
  
  <pre><code>function downloadURL(url) {
      var hiddenIFrameID = 'hiddenDownloader',
      iframe = document.getElementById(hiddenIFrameID);
      if (iframe === null) {
      iframe = document.createElement('iframe');
      iframe.id = hiddenIFrameID;
      iframe.style.display = 'none';
      document.body.appendChild(iframe);
      }
      iframe.src = url;
  };
  </code></pre>
  
  <p>This can work perfectly for downloading a file, but right now, I want to <strong>get the return http status code</strong>, if the http status code is not 200, I'd like to <code>alert</code> something out. </p>
  
  <p>Could anyone tell me how to retrieve that? Thanks in advance.</p>