Accepted answer

You can by disabling the respective security mechanisms in your browser. I think it works in Opera by default, and you can start Chrome with the --allow-file-access-from-files command line flag to allow loading data from file://.


Similar to the python answer from Christopher Chiche above, you can also use the built-in server that comes with various versions of PHP.

php -S localhost:8888 & 

This was more useful for me, as my application has hooks to a php back-end script as well as the d3 front-end.


Adding onto Christopher Chiche's answer (I am a new user, can't comment). For python 3 in Windows, that command does not work. Instead use this one

python -m http.server [<portNo>]

As described here, in python 3

the module SimpleHTTPServer has been replaced by http.server, at least in Windows.


The best solution would be to run a server on your computer to make it work.

The simplest way to have a local web server, as explained here is to run this command in the directory where you have your source code:

python -m SimpleHTTPServer 8888 &

Then just load the page http://localhost:8888

Related Query

More Query from same tag