CORS Error?


#1

Hi guys,
I’m trying to do a HTTP.get but when i click the button to get the information from the webhost i get this error:

XMLHttpRequest cannot load http://www.wikicode.co.uk/announcement?date=value2&message=value3&name=value1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.

Does anybody know how to fix this without setting up a proxy or does anybody know webhosts which support CORS??

When i run this on my android phone i still get an error.

Thanks


#2

Add this to server code:

header(‘Access-Control-Allow-Origin: *’);

Can check this:
http://www.html5rocks.com/en/tutorials/cors/
http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server


#3

Where do i add it? What file and what location?