patrickfuller / jgraph

An embeddable webGL graph visualization library.
http://patrickfuller.github.io/jgraph
MIT License
133 stars 31 forks source link

Cannot acces to the json from local install #2

Closed ynnk closed 11 years ago

ynnk commented 11 years ago

i cloned your repository and just launched chromium-browser index.html from ./examples

Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. file:///home/yk/github/igraph/example/miserables.json XMLHttpRequest cannot load file:///home/yk/github/igraph/example/miserables.json. Origin null is not allowed by Access-Control-Allow-Origin.

patrickfuller commented 11 years ago

There is a longer explanation of Access-Control-Allow-Origin, but it boils down to the fact that you need an http server rather than just rendering an html file. In the root igraph directory, run python -m SimpleHTTPServer, and then go to localhost:8000/example. This allows the html to make requests for external files.