0

I have been trying to get the example from How to parse an RSS feed using JavaScript? working. My HTMl/script is below. The get request isn't working. I'm not getting any errors, just nothing happening. Is this because of cross-domain issues? Can anyone spot the issue? Ultimately, I want to pull treasury prices from government rss feeds such as: http://www.federalreserve.gov/feeds/Data/H15_H15_RIFSGFSW04_N.B.XML Am I taking the right approach?

<!DOCTYPE html>
<html>
<head>

<script src="jquery-1.11.1.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
<script>
$(document).ready(function() {
alert('Jquery working fine');
    $.get('https://stackoverflow.com/feeds/question/10943544', function (data) {
    $(data).find("entry").each(function () { // or "item" or whatever suits your feed
        var el = $(this);

        console.log("------------------------");
        console.log("title      : " + el.find("title").text());
        console.log("author     : " + el.find("author").text());
        console.log("description: " + el.find("description").text());
});
});

});
</script>

</head>

<body>
</body>

Community
  • 1
  • 1
DVCITIS
  • 1,067
  • 3
  • 16
  • 36
  • The answer is yes it's a cross-domain issue, but "nothing" is not happening, you will be getting a notice `XMLHttpRequest cannot load (url) No 'Access-Control-Allow-Origin'`. You can, instead, bounce the request via your local server. – Popnoodles Aug 25 '15 at 17:17
  • Ok thanks. Whilst there seem to be ways to circumvent the same origin policy, Im reading that it isnt something I should do. With regard to teh federal reserve rss feeds (example: http://www.federalreserve.gov/feeds/Data/H15_H15_RIFSGFSW04_N.B.XML), are they just there for internal use? why would there be RSS feeds made publicly available like this if not to access like im trying to do in this question? – DVCITIS Aug 25 '15 at 17:24
  • Possible duplicate of [jQuery YQL SELECT FROM rss variable](http://stackoverflow.com/questions/5554804/jquery-yql-select-from-rss-variable) – Paul Sweatte Oct 01 '15 at 19:41

0 Answers0