Hi,
I’m almost done with this practice project that I’ve been working on. The last thing that I need to do is append 3 lines of text. The first line is the name of the artist, the second line is the name of the album, and the third is a link taking you directly to the spotify website specifically for the album which you’ve already clicked on.
If you look up an album and click on a thumbnail, it will show the respective image, but will say undefined for every caption. I believe this is related to lines 20 and 46 of my JavaScript.
If you could please help me with the first line of text, then I’ll see if I can do the second and third lines on my own. Thank you.
So the short answer is that album.artists is an array (just like album.images), so you’d have to reference the first item of said array to get the values you need. In other words, change this:
Any reason you’re using such an old version of jQuery?
Do you mind using ES6? This means worse compatibility for older browsers, but is not an issue if you are targeting modern browsers. In other words, IE8/9 won’t run ES6 very well, but latest Chrome, FF, IE, Edge, Opera, Safari all will.