// `); } function resultsLoop(data) { $.each(data.items, function(i, item) { var thumb = item.snippet.thumbnails.medium.url; var title = item.snippet.title; var desc = item.snippet.description.substring(0, 100); var vid = item.snippet.resourceId.videoId; $('#playlist').append(` ${title} ${desc} `); }); } // CLICK EVENT $('#playlist').on('click', 'article', function() { var id = $(this).attr('data-key'); mainVid(id); }); }); // ]]>