I'm trying to parse some simple JSON data and pull out certain parts to display as HTML. All is going well apart from my Last.fm JSON data has a child of recenttracks.track.artist_text
The text isn't being translated or picked up properly and (as I'm new to this) cannot figure out why? The reason I believe is something to do with the underscore _
before the last child.
Everything is working well apart from this.
<script type="text/javascript">
$.getJSON("http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=foo&api_key=bar&format=json&limit=1", function(json) {
alert("JSON Data: " + json.recenttracks.track.artist._text);
});
</script>
Any ideas what i'm doing wrong?
Thanks.