Origin null is not allowed by Access-Control-Allow-Origin

by kiawin

If you are testing a simple ajax and found an error from Google Chrome’s element inspector,

XMLHttpRequest cannot load file:///. Origin null is not allowed by Access-Control-Allow-Origin.

High chances you are running the files directly from your computer (file://). Throw them in your localhost web server and it will work automagically.

My own dumb discovery :)