Q:

How to load data using XHR in D3

I am experimenting with D3 on my localhost.  I would like to load data to be visualized from an external source on the Internet.  
I am looking for instruction/examples of how to how to load data using XHR in D3 (there is documentation here, but it does not suffice for me, I am looking for code snippets https://github.com/mbostock/d3/wiki/Requests) 
I have tried the following and it does not work for me: 
d3.xhr("http://example.org/json-test.json", function(data){

    alert(data); //no data is returned

});

Thanks

A:

In the latest version of D3, the first argument of the callback is the error, if any, and the second the data.  No data in the first argument (which you're checking) suggests that the request was successful.  See the documentation for more details.