我正在尝试获取name
oftrack
并且它不起作用:我这样做:
$.ajax({
type: "GET",
url: "http://ws.audioscrobbler.com/2.0/?method=track.getInfo&api_key=b25b959554ed76058ac220b7b2e0a026&track="+yourTrack+"&artist="+yourArtist,
dataType: "xml",
success: function(xml) {
$(".loading").css("display", "none");
$(xml).find('track').each(function(){
var id = $(this).find('id').text();
console.log("Success!");
var song = $(this).find('track > name').text();
var name = $(this).find('artist name').text();
var album = $(this).find('album title').text();
$("#more").append("\nSong: " + song);
$("#more").append("\nArtist: " + name);
$("#more").append("\nAlbum: " + album);
$("#more").append("\n\nlast.fm ID: " + id);
});
}
});
结果是这样的:
Song:
Artist: Hinoi Team
Album: Super Euro Party
last.fm ID: 43135480
帮助?