Jsonplaceholder: Allow Cross Origin?

Created on 30 Mar 2014  ·  3Comments  ·  Source: typicode/jsonplaceholder

When attempting to POST via jQuery's AJAX function, I'm unable to use crossDomain: true to allow my testing server to use your POST resource. Would this be solved by setting up the resource to allow for this, or is it something I need to do differently on my end? I prefer not to use JSONP in this instance.

XMLHttpRequest cannot load http://jsonplaceholder.typicode.com/posts. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. 

Most helpful comment

This may just be the result of my Chrome browser, opened with

open -a Google\ Chrome --args --disable-web-security

and seems to bypass the issue. Going to close the issue. Thanks for this lib!

All 3 comments

This may just be the result of my Chrome browser, opened with

open -a Google\ Chrome --args --disable-web-security

and seems to bypass the issue. Going to close the issue. Thanks for this lib!

Where you write this?

In Mac OSX or Linux terminal. If you're on Windows, just look into setting Chrome flags

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alex2118 picture alex2118  ·  6Comments

shimulxx picture shimulxx  ·  3Comments

antoniputra picture antoniputra  ·  3Comments

Robinfr picture Robinfr  ·  4Comments

rmat0n picture rmat0n  ·  7Comments