jQuery from alternate domain with CORS

(Tim) #1

Hi,

I am looking to use jQuery and ajax on another domain for some reporting.

When I try and draw the data down I get the following response.

XMLHttpRequest cannot load https://www.commcarehq.org/a/
https://www.commcarehq.org/a/akeman/api/v0.4/case/?format=xmlxxxxxxx
http://www.akemansolutions.com//api/v0.4/case/?format=xml. No
’Access-Control-Allow-Origin’ header is present on the requested resource.
Origin ‘http://www.xxxxxxx.com http://www.akemansolutions.com/’ is
therefore not allowed access.

I presume this is because the server isn’t set up for CORS, but I could be
wrong.

Has this been done before?, am I missing something obvious? and if it does
need configuring, can you?

Much thanks in advance

Tim

0 Likes

(Tim) #2

Hi,

Has anyone else experienced this? And found a workround?

Much thanks in advance

Tim

··· On Friday, August 1, 2014 5:07:58 PM UTC+1, Tim Butler wrote: > > Hi, > > I am looking to use jQuery and ajax on another domain for some reporting. > > When I try and draw the data down I get the following response. > > XMLHttpRequest cannot load https://www.commcarehq.org/a/ > xxxxxxx > /api/v0.4/case/?format=xml. No > 'Access-Control-Allow-Origin' header is present on the requested resource. > Origin 'http://www.xxxxxxx.com ' is > therefore not allowed access. > > I presume this is because the server isn't set up for CORS, but I could be > wrong. > > Has this been done before?, am I missing something obvious? and if it does > need configuring, can you? > > Much thanks in advance > > Tim > > >
0 Likes

(Anastasia Stefanuk) #3

Hey Tim! I think it really great that you are not afraid to ask about such problems like this. But as soon as possible to fix it you can asking for help of professional dev. I know one company where in the end of the article you can leave you contact and ask for help. Read this blog post and in the end you will see. Enjoy!

0 Likes