-3

Possible Duplicate:
Cross-Domain Requests with jQuery

$(function () {
    (function getFeed() {
        $
            .get('http://feeds.bbci.co.uk/news/world/rss.xml')
            .done(function (feed) {
                console.info('\Feed received: ', feed);
                displayProgrammes(feed);
            })
            .fail(function () {
                console.info('\nError getting the feed.');
            })
    }());
});

It's a simple Ajax request, nothing more. And yet I get the error message:

Origin null is not allowed by Access-Control-Allow-Origin.

Community
  • 1
  • 1
Randomblue
  • 112,777
  • 145
  • 353
  • 547

1 Answers1

2

Requests in AJAX can only be made to the same domain, this is called the Same Origin Policy ->

http://en.wikipedia.org/wiki/Same_origin_policy

(Example of a way around this issue using PHP as a proxy : http://devtreats.blogspot.com/search/label/ajax)

There is another way .... YQL -> Cross-Domain Requests with jQuery

Community
  • 1
  • 1
Manse
  • 37,765
  • 10
  • 83
  • 108