Reputation: 5
Hi have the following function:
function last()
{
/* Create a cache object */
var cache = new LastFMCache();
alert("test");
alert("test2");
/* Load some artist info. */
lastfm.artist.getInfo({artist: 'The Killers'}, {success: function(data){
alert(data.bio);
$('gallery').append(data.to_html('<p>${bio}</p>'));
}, error: function(code, message){
/* Show error message. */
}});
}
alert(data.bio) shows up as undefined. How would I check what data is being held and how can I used and format it correctly on my webpage?
Upvotes: 0
Views: 151
Reputation: 50251
How would I check what data is being held?
console.log(data);
in your success callback function. Run the code, and inspect the contents at your heart's content. I recommend Firefox as having a superior object browser to Chrome, but you can also...Knowledge acquired!
Upvotes: 1