I'm trying to pull images from the spotify API and give those images a lightbox. I've created a lightbox for images before but just not with using JSON data. Not sure what my code is missing. Your help would be greatly appreciated.
This is an example of the JSON data that I'm trying to pull from. Below, I've bolded the areas in my HTML, CSS, and Javascript which are directly related to the lightbox.
// var albums = $searchField.val();// Specifies type of user info to be retrieved and sent to Spotify API
var spotifyOptions = {
"type": "album",
"query": $("#song").val(),
"limit": "12"
}; // Requests data from spotify API. Must be a JavaScript Object
$.getJSON(spotifyAPI, spotifyOptions, displayAlbums); // Currently, these are only placeholders. The variables inserted as arguments have not been defined as variables
function displayAlbums(data){
console.log(data);
var albumHTML = '<ul>'; // Opening ul tag to hold a single album result
I'm trying to learn how to make JSON requests. Kind of struggling with it. Specifically, I'm trying to access the Spotify API and display search results (i.e. thumbnails of albums) based on user input. This is what I have so far. Please tell me what I'm doing wrong or missing. Thanks.
$.getJSON(spotifyAPI, spotifyOptions, displayAlbums); // Currently, these are only placeholders. The variables inserted as arguments have not been defined as variables