Is that actually working? XPath selectors are not supported in jQuery
anymore.

Make it simple:

$(function() {

$.ajax({
    type: "GET",
    url: "http://anthonyjamesbruno.com/blog/?feed=rss2";,
    dataType: "xml",
    success: function(rss) {
       strRSS = "<h4>" + $("/rss/channel/title",rss).text() + "</h4>";
        $("/rss/channel/item:lt(5)",rss).each(function(i) {
           var t = $(this),
           link = t.find('link'),
           title = t.find('title'),
           description = t.find('description').text().substring
(0,200);
                $('<li/>')
                  .click(function(){ window.location.href = link })
                  .append( title + '<br />' +
description )
                  .appendTo('#feed_me');
      });
   }
});


On Jan 31, 7:51 pm, anthonyb <anthonybr...@gmail.com> wrote:
> Ive been editing this a little bit and thought that what i have below
> would work. but it doesn't.
>
> $(function() {
>
>     $.ajax({
>         type: "GET",
>         url: "http://anthonyjamesbruno.com/blog/?feed=rss2";,
>         dataType: "xml",
>         success: function(rss) {
>             strRSS = "<h4>" + $("/rss/channel/title",rss).text() + "</
> h4>";
>             $("/rss/channel/item/title:lt(5)",rss).each(function(i) {
>                 strRSS += "<li onClick='location.href='";
>                 strRSS += $("/rss/channel/item/link:eq(" + i +
> ")",rss).text();
>                 strRSS += "';'>";
>                 strRSS += $(this).text();
>                 strRSS += "<br />";
>                 strRSS += ($("/rss/channel/item/description:eq(" + i +
> ")",rss).text()).substring(0,200) + "...</li>";
>             });
>             $("#feed_me").html(strRSS);
>         }
>     });
>
> });

Reply via email to