Ajax jquery error requesting rss

Asked

Viewed 31 times

0

I’m trying to get the G1 RSS which comes in XML but error No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. follows the code:

    $.ajax({
      url: "http://pox.globo.com/rss/g1/brasil/",
      dataType: 'xml',
      success: function (data) {}
});

I’ve researched several places, tried to add headers but if successful, how can I solve?

  • @Bacco unfortunately I cannot solve with that answer

  • Place crossDomain: true in your AJAX did not work?

  • @Arturotemplário put and it was not

  • 1

    Access-Control-Allow-Credentials: true, But if you want a good tip look at https://www.html5rocks.com/en/tutorials/cors/ and see the part with Jquery request.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.