Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Tam Dao316 Points
My browser cannot load the climate-data.csv due to cross origin issue.
I'm not using workspace. I downloaded the project files and open it on my text editor. I got this error when I made the d3.csv request in dataBinding.html:
XMLHttpRequest cannot load file://Users//Documents//D3js-master/Stage2/examples/climate_data.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Marco Flores7,971 Points
Happened the same to me,
You should run the html examples within a web server, because d3.json(), d3.csv(), etc perform ajax request internally to get data.
One way to setup a simple http server is with python 3.
I downloaded the project files and place it in C:\D3js-HustonHedinger-master
Then with cmd, and located in that directory, start a web server:
python -m http.server 8000 --bind 127.0.0.1
Then browse http://127.0.01:8000/Stage2/examples/dataBinding.html