No Access Control Allow Origin

Avatar image for herrpfister
herrpfister

13

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

#1  Edited By herrpfister

So I am trying to build a web application with Angular, and whenever I try to query the api I always get this error:

No 'Access-Control-Allow-Origin' header is present on the requested resource.

and this is the link I am using:

http://www.comicvine.com/api/issues/?api_key=[api_key]&filter=limit:50&format=json

I am trying to grab 50 comics from the service when they load the page, using ng-resource. I believe I am getting this because of backend security against cross-site scripting, but does anyone have any idea on how to deal with this? Thanks

Avatar image for herrpfister
herrpfister

13

Forum Posts

0

Wiki Points

0

Followers

Reviews: 0

User Lists: 0

So I figured it out. If anyone comes across this issue, the best way to avoid this error, is by creating a server that queries the api for you. That way, the server can retrieve the data and send it back to your web application. Mitigating the limitations of the browser on same domain issues. Works like a charm now!