I am remixing this site: https://year-end-list.glitch.me and I’m wondering how to add a URL for each book. I know that I could add the link in the text description, but is there a way to add a clickable URL to the image or to each book object?
I am new to JSON, so any help would be greatly appreciated!
The images are currently coming from the JSON file:
{
"title": "Sabrina",
"author": "Nick Drnaso",
**"cover": "https://images.gr-assets.com/books/1513309376l/37533587.jpg",**
"review": "Sabrina is the first graphic novel to ever be nominated for the Man Booker Prize. Illustrated in mostly muted colors, it has a fantastically compelling way of representing the black hole of fake Internet news.",
"categories": ["fiction", "graphic"]
}\
var cover = `<a href=${favorite.link}><img class="cover" src=${favorite.cover}></img></a>`;
I have checked the webpage to see if I did this correctly, but nothing shows up, that could be my problem, or maybe you have done something to have this happen:
I think the reason nothing was showing up is because on the first item the word link was not in quotes, whereas in the second object it is in quotes (as shown in your code above). I added quotes to the first object and now it works! I really appreciate your help!!