I am trying to retrieve this JSON data and display it in a D3 project and can't seem to get d3.json to do this.
I've tried this:
d3.json("https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/cyclist-data.json", function(data) {
console.log(data);
})
I've also tried saving it locally and loading it in like this:
d3.json("cyclist-data.json", function(error, d){
console.log(d);
});
I've also tried saving the url into a variable and passing the variable to the d3.json function like this:
var url = 'https://raw.githubusercontent.com/freeCodeCamp/ProjectReferenceData/master/cyclist-data.json';
d3.json(url, function(data) {
console.log(data);
})
None of this works. How can I successfully pull the JSON data and console.log it?