Reputation: 1073
Im creating a mobile app with Phonegap and Backbone.js. My app hits a url which returns an rss feed in xml format and this is to be loaded into the Backbone connection. However I am getting the error:
Origin http://localhost is not allowed by Access-Control-Allow-Origin.
In my res/xml/config.xml I have the line:
<access origin="*"/>
The phonegap docs at http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html, state that this should stop this type of error, but it's not.
I'm testing from localhost on a desktop browser. Could this be the issue?
Upvotes: 0
Views: 3191
Reputation: 1073
I was testing in a browser, the whitelist in res/xml/config.xml only works on a mobile device.
Upvotes: 0
Reputation: 2014
Put his in your top in your PHP file that you make the request to:
header('Access-Control-Allow-Origin: *');
I take it that you use php :)
if now please say which language :)
Upvotes: 2