私がこのようなものを持っているとしましょうXML:http ://ws.audioscrobbler.com/2.0/?method = track.getInfo&api_key = b25b959554ed76058ac220b7b2e0a026&track = Just%20for%20Me&artist = Hinoi%20Team
枝の<name>中に入れたいです。ただし、XMLで名前が付けられた<artist>他のタグもあります。<name>具体的に内部のものをターゲットにするにはどうすればよい<artist>ですか?
これが私が使用しているものです:
$.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).attr('id');
console.log("Success!");
var name = $(this).find('name').text();
$("#more").append("Listing results...\n");
$("#more").append("Name: " + name);
});
}
});