I wrote a little javascript web app for iOS where I use XMLHTTPRequest
to retrieve data from a web service (over which I have no control). JSONP is not available. I'm not using jQuery.
When I access the site via file://
, it works just fine, but when I access the site via http://
on a locally hosted server, it doesn't work. Safari complains that
Origin http://mydomain is not allowed by Access-Control-Allow-Origin
I have already tried adding Access-Control-Allow-Origin: *
to my headers, but it doesn't work.
What am I doing wrong?