Last Updated: February 25, 2016
·
3.936K
· jdlich

Local AJAX calls in Chrome

If you try to use AJAX on local files in Chrome, you may run into the following error:

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

To get around this, quit and reopen Chrome using the command line while passing in the --allow-file-access-from-files flag:

open -a "Google Chrome" --args --allow-file-access-from-files

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside