When I am running the following code:
For security reasons, browsers blocks Ajax HTTP requests (XHR) from different hosts (origins).
The d3.json("...") function makes an Ajax request to your http://localhost/... and you are probably serving the HTML from a different host.
Are you opening the .html as file in the browser? Thats considered a different host. You have some options there:
var mygeodata = {your json here} to the file and adding in the HTML while also removing the d3.json("...") part. After that you have a global variable with your data in mygeodataIf you are studying/prototype (by the looks of it) I would go with the second approach.