So I finally got it to work but I used a little different code.
<!DOCTYPE html>
XML & AJAX
$(document).ready(function(){
$.ajax({
type: "GET",
url: "NewsFeed.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('item').each(function(){
var title = $(this).find('title').text();
var link = $(this).find('link').text();
var date = $(this).find('pubDate').text();
$('').html('' + title + '').appendTo("#news");
});
}
});
});
I can't get the styling of my UL elements correct. I want each LI to have a hyperlink wrapped around the title followed by the date it was published without the link wrapped around it.
I have an RSS feed that I want to read using JQuery and take the data and populate a list with. Can anyone give me a shove in the right direction?
Maybe check out the jQuery Google Feed Plugin (you don't need an API key anymore)
That didn't really cover what I was needing.
The RSS feed that I'm trying to read into a UL is structured like this.
Anyone have any suggestions?
RSS is just XML, so you should be able to use jQuery's XML capabilities (
$.parseXML()).Then you can navigate it just as you would any other DOM.
The link you provided just shows it outputing XML. I need it to read an RSS feed and have it populate a UL.
Would you consider using php to do this?
I can't use PHP. My network admin does not allow PHP.
You can do it with
$.parseXML().Example:
So I finally got it to work but I used a little different code.
I can't get the styling of my UL elements correct. I want each LI to have a hyperlink wrapped around the title followed by the date it was published without the link wrapped around it.
Never mind, I caught my mistake. I was escaping the hyperlink to early.