Quantcast
Channel: jQuery.get(): Trying to retrieve feed, but XML tags are lost - Stack Overflow
Viewing all articles
Browse latest Browse all 5

jQuery.get(): Trying to retrieve feed, but XML tags are lost

$
0
0

I'm using jQuery to automatically fetch the most recent post on a blog. jQuery.get() goes to the blog's RSS feed and returns the most recent post:
Here's what I'm using:

$.get('http://url.to/feed', function(feed) {data = $(feed).find('item:first').text(); $('#testbox').html(data);}, 'xml');

Here's the problem: That spits out just the text from the feed and the HTML elements. All the stuff like <title>Title</title is just stripped to Title. I need to keep all those XML elements intact so I can style things properly.

I've also tried .html() instead of .text(), but that doesn't work. Using neither one also doesn't work (i.e. data = $(feed).find('item:first');).

How can I download and display a section of an RSS feed and not strip the XML tags?
Thanks!


Viewing all articles
Browse latest Browse all 5

Latest Images

Trending Articles





Latest Images