0

https://github.com/DataNeel/d3js_trade_routes

Very new to js and d3, so I appreciate the help.

I wrote this code locally using sublime text, and immediately had problems loading it in Chrome. Loading it in chrome shows a grid for my map, but it doesn't show the countries. It worked in Safari, however, so I continued to learn d3.js while previewing the file in safari.

When I upload the file to github and download/extract the files locally, the file no longer works in chrome. I ran "diff -rq folder1 folder2" on the original and the downloaded versions, and no difference was found.

Anybody have any idea what is going on?

neelshiv
  • 6,125
  • 6
  • 21
  • 35
  • 1
    What do you see in the console? How are you running it? AJAX won't work for `file://` URLs. – SLaks May 27 '14 at 23:56
  • Thanks for the response, @SLaks. I'm new to js, and didn't know about checking the console. The console in chrome has three errors, and this is the first one. `XMLHttpRequest cannot load file:///Users/neelshivdasani/Desktop/d3js_trade_routes/world-50m.json. Cross origin requests are only supported for HTTP.` I'm looking into that error, and it is becoming clear that I can't just reference local files like that. – neelshiv May 28 '14 at 00:04
  • Yes; you need to use a localhost web server. – SLaks May 28 '14 at 00:07
  • Thanks! I'll read up on that subject and get things sorted out. – neelshiv May 28 '14 at 00:08

0 Answers0