开发者

MediaRSS parsing in Javascript

I'm trying to read the Flickr feed in order to parse the images. However, the images are in the media:thumbnail t开发者_如何学Goag. Where would I begin to make a mediaRSS parser? Does anyone have an example?


I recommend jQuery.getJSON(). As far as i know Flickr provides a JSON feed.

Here is an example from a current project using jQuery and xml:

$("#loading").show();
$.ajax({
    type: "GET",
    url: "/path",
    dataType: "xml",
    success: parseXml
});

function parseXml(xml) {
    $(xml).find("item").each(function() {
        $("#news_list").append('<p>Content</p>');
        $("#loading").hide();
    });
}

Works awesome! You only have to change the datatype to json.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜