Strikers
Strikers

Reputation: 4776

Error: Cross origin requests are only supported for HTTP with D3js

I was trying to generate sunburst chart from the example provided here

What I did is just copy the entire JSON in my local and then the index.html

I didn't do any changes to any of the files.

When I tried to run the html file I'm getting these errors

XMLHttpRequest cannot load file:///C:/Users/VK/Documents/D3%20charts/sunburst/flare.json. Cross origin requests are only supported for HTTP. d3.v3.min.js:1
Uncaught TypeError: Cannot read property 'children' of undefined d3.v3.min.js:2
Uncaught NetworkError: A network error occurred. d3.v3.min.js:1

found a similar question asked here but I don't want to load it form the webserver

Can any one help me to solve the issue.

Upvotes: 4

Views: 5606

Answers (1)

dasersoft
dasersoft

Reputation: 155

Modern browsers don't support loading files through file:// so the best you can do is load your frontend through a web server.

Upvotes: 2

Related Questions