{title}


Code RSS Feed

Code

A way around access control origin errors

TOPICS:
  • Apache

Ever try to post to a web service or access AJAX data from a different domain, and get those annoying access-control origin errors? Often, these result from the remote host’s server configuration being not set up to accommodate requests from your IP. If accessing the remote server is something that is beyond your control, but you still need to be able to test your code, here’s an easy way around access-control origin errors.

1. You’ll need Chrome (although I’m sure this is possible with other browsers as well).
2. You’ll need to open up Terminal (yes, I hate it to).
3. Simply paste in the following code:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security