I am trying to get a json feed and display the names of the artists. on the line that says element.artist, it displays [object Object],[object Object],[object Object] . I am very new to this. How would I display the contents of these objects?
<script type="text/javascript">
$(document).ready(function() {
$.ajax({
type: 'GET',
url: 'http://ws.audioscrobbler.com/2.0/?method=artist.getsimilar&artist=richie%20hawtin&api_key=53c21030b0e4c4ff051083aacdc6dc54&format=json',
data: { get_param: 'value' },
dataType: 'json',
success: function (data) {
$.each(data, function(index, element) {
$('body').append($('<div>', {
text: element.artist
}));
});
}
});
});
</script>