【发布时间】:2014-12-11 19:37:50
【问题描述】:
我正在尝试从 iTunes 前 100 名 RSS 源中提取数据。我似乎无法从 <im:name> 之类的标签中提取数据
代码:
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);
title 标签有效,但 i:name 标签无效。我不知道为什么。
数据的 xml/ 链接位于 $.get(....) 下的加载函数中。
【问题讨论】: