title: How to download a json file from S3 via d3.json
body: <p>I have setup a S3 bucket and upload there some json files. Each file has Content-type: application/json. The files accessible via URL, if I type it in the browser or use wget, I can download it without any problem.</p>
  
  <p>But if I try to download this file via d3.json or d3.xhr, the function return null:</p>
  
  <pre><code>d3.json(jsonUrl, function(json) {
      alert(json); 
  });
  
  d3.xhr(jsonUrl, function(r) {
      alert(r);
  });
  </code></pre>
  
  <p>I have opened debug console in the Firefox and I can see, that the request url is correct and it does pass and the response was 200, but there is no data in the response. </p>
  
  <p>Update. It turns out what browser does allow to download file from different host via java script (as described in <a href="http://www.w3.org/TR/cors/" rel="nofollow">http://www.w3.org/TR/cors/</a>). I have setup a proxy in Apache and currently it works, but I'm searching for a better solution. </p>