views:

490

answers:

3

I used a jQuery library called jFeed to parse and display my blogs rss feed on my personal website. It worked perfectly well at first, but upon checking later it simply displays nothing, except in Internet Explorer, where it seems to work fine.

After checking the javascript console using Firebug in Firefox, it shows an error in the 'XML' tab as follows:

XML Parsing Error: no element found Location: moz-nullprincipal:{3f8a0c62-32b4-4f63-b69c- 9ef402b40b64} Line Number 1, Column 1: ^

Though I have no idea what to do with this information. Here is the code I used to get the rss feed and display it (it is almost exactly the same as the example provided by the jFeed website):

jQuery.getFeed({ url: 'http://sammarshalldesign.co.uk/blog/wordpress/?feed=rss2', success: function(feed) {

        var html = '';

        for(var i = 0; i < feed.items.length && i < 5; i++) {

            var item = feed.items[i];

            html += '<h3>'
            + '<a href="'
            + item.link
            + '">'
            + item.title
            + '</a>'
            + '</h3>';


            html += '<div>'
            + item.description
            + '</div>';
        }//end for

        jQuery('#feed').append(html);
    }//end feed function    
});//end getfeed

Any help would be really appreciated.

A: 

Are you trying to load the RSS feed from another domain? If so, it won't work. jFeed comes with a sample PHP proxy that you can place on your server and call. Or, you can use Yahoo! Pipes to get the data in JSON format.

Callmeed
A: 

As an alternative, Google does provide a feed api. Check out this Google Feed Plugin that makes the whole process pretty easy (no php required).

fudgey
A: 

I discovered this the hard way, but unlike Internet Explorer, Firefox doesn't allow for cross-domain XML requests without some kind of authentication from the server you're hitting.. you'll need to either use JSON (with which you can do a cross-site / cross-domain request in jQuery), or create some kind of proxy for your XML feed locally and then hit that with your jQuery request.

nickb