"Origin null is not allowed by Access-Control-Allow-Origin" in Chrome. Why? [duplicate] "Origin null is not allowed by Access-Control-Allow-Origin" in Chrome. Why? [duplicate] google-chrome google-chrome

"Origin null is not allowed by Access-Control-Allow-Origin" in Chrome. Why? [duplicate]


Chrome doesn't believe that there's any common relationship between any two local files.

You can start it with the option "--allow-file-access-from-files" to tell it you disagree.

Thanks to the ascendant master Nick Craver for this info when I asked essentially the same question some time ago.


If you are using Mac OS X, open up the Terminal, cd to your web root and run:

python -m SimpleHTTPServer

Then open the following URL in Chrome (or any other web browser):

http://0.0.0.0:8000


It's like crossdomain for some unclear reason (each browser acts a bit differently regarding this issue, you could even try IE and see the results). You should try and run it through a web server, and give it an absolute path since the javascript runs locally.