Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing last.fm API in javascript
    primarykey
    data
    text
    <p>I have very little experience with web development. I have a little experience with HTML and I am learning JavaScript right now. I created a program in Java using a a last.fm library for Java. I was able to get user information, artist information, and venue information. Now I want to try and do that in a webpage, which is where my problem occurs. </p> <p>I'm using the javascript last.fm api given here <a href="http://github.com/fxb/javascript-last.fm-api" rel="nofollow noreferrer">http://github.com/fxb/javascript-last.fm-api</a> I've downloaded all the .js files and they are in the same directory as my .htm file. </p> <p>This is my code so far.</p> <pre><code>&lt;html&gt; &lt;body&gt; &lt;script type="text/javascript" src="lastfm.api.md5.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="lastfm.api.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="lastfm.api.cache.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var cache = new LastFMCache(); var lastfm = new LastFM({ apiKey : 'c9946d11aaaaaaaaaaaaaaaaaaaaaaaace', apiSecret : '9dabf9aaaaaaaaaaaaaaaaxxx11ec3c7a993', cache : cache }); lastfm.artist.getInfo({artist: 'The xx'}, {success: function(data){ /* Use Data */ }, error: function(code, message){ /* Show error message. */ }}); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I've dug around in the included .js files to try and understand what is going on. So on my initialization of lastfm, I am passing in some objects with associated values, which are then applied to lastfm. If I try and access them through document.write(lastfm.apiKey) I get an undefined value, which I don't really understand. </p> <p>Also I see that I am calling getInfo and passing in 'The xx' and everything that follows. I don't understand how to use that Data that I believe is returned as a JSON response. How can I print the bio that is associated with that artist?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload