By default, Chrome does not allow cross origin requests via AJAX from your localhost for a variety of security reasons. This is great, but we developers need to test AJAX locally.
open -a Google\ Chrome --args --disable-web-security
Shutdown Chrome, then run the above command in terminal. This will restart the browser without the web security settings blocking AJAX requests across origin. You should now be able to make requests with AJAX for things like json from external APIs. Once you are done testing, just restart Chrome to open it with the default settings again.
Leave a Reply