I have established an S3 bucket and uploaded some JSON files there. Each file is set with Content-type: application/json. The files can be accessed via URL, as I am able to download them without any issues by typing the URL into my browser or using wget.
However, when attempting to download these files using d3.json or d3.xhr functions, the result is null:
d3.json(jsonUrl, function(json) {
alert(json);
});
d3.xhr(jsonUrl, function(r) {
alert(r);
});
I checked the debug console in Firefox and confirmed that the request url is correct and it's successfully executed with a response status of 200, but no data is returned in the response.
Update: It appears that the browser does not allow downloading files from different hosts via JavaScript (as outlined in http://www.w3.org/TR/cors/). I have implemented a proxy in Apache for now, which is working fine. However, I am still exploring better solutions.