I spend a lot of time trying to solve the errors from this statement to show the content of the json url in the console.log:
d3.json( urlpathtojson, function(error, jsondata ) {
var jsonfile = JSON.parse(jsondata);
console.log(jsonfile);
}):
I could see the GET statement and the contents of the JSON request, but the console gave following error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
Or in other cases without parsing:
ReferenceError: jsondata is not defined
Or
jsondata is undefined
Below is the answer which I found on Stackoverflow. Hopefully it will help someone else as well.