-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.

9
  • Can you please let us now what you are trying to do? Commented Nov 1, 2011 at 15:02
  • It's a simple cross-domain Ajax request which isn't possible out of the box. Commented Nov 1, 2011 at 15:03
  • @campino2k: I'm trying to extract the XML from the feed! Commented Nov 1, 2011 at 15:03
  • 2
    @Random that doesn't matter, it's a browser side security mechanism. Commented Nov 1, 2011 at 15:05
  • 2
    @Randomblue: use a server side action (php, ruby, whatever) to access crossdomain or check if they offer a JSONP-Interface. Commented Nov 1, 2011 at 15:07

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.