Using jQuery to parse an RSS feed, having trouble in firefox and chrome.

Posted by sjmarshy on Stack Overflow See other posts from Stack Overflow or by sjmarshy
Published on 2010-03-14T16:55:22Z Indexed on 2010/03/14 18:25 UTC
Read the original article Hit count: 420

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about Xml