CinCity
CinCity

Reputation: 149

Pulling information from Itunes Top songs rss feed(xml) with jquery

I'm trying to pull data from itunes top 100 rss feed. I can't seem to pull data from tags like <im:name>

Code:

var loadFunction = function() {
        $.get( "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/limit=10/xml", function(data) {
            //$("#student").html("");
            var studentArray = $(data).find("entry");

            studentArray.each(function() {
                var sname = $(this).find("title").text();
                var sid = $(this).find("im:name").text();
                var fees = $(this).find("fees").text();
                var units = $(this).find("fees").attr("units");
                $("#student").append(
                    "<h3>" + sname + "</h3>ID:" + 
                    sid + "<br>Fees to be paid:" + 
                    fees + " " + units + "<br>");
            });
        });
    }

    $(document).ready(loadFunction);

The title tag works, but the i:name tag doesn't. I have no idea why.

The xml/ link for the data is in the load function under the $.get(....).

Upvotes: 0

Views: 378

Answers (1)

Ted
Ted

Reputation: 14927

It's namespaced...change it to this:

var sid = $(this).find("im\\:name").text();

Upvotes: 1

Related Questions