jQuery - Getting certain XML not working

Sorrento

New Member
Let's say I have an \[code\]XML\[/code\] like this: http://ws.audioscrobbler.com/2.0/?m...7b2e0a026&track=Just for Me&artist=Hinoi TeamI'm trying to get the \[code\]name\[/code\] of the \[code\]track\[/code\] and it's not working: I do this:\[code\]$.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); }); } });\[/code\]and the result is this:\[code\]Song: Artist: Hinoi TeamAlbum: Super Euro Partylast.fm ID: 43135480\[/code\]Help?
 
Back
Top