Trying to work through a program I currently have, where I am unable to view the videoID from a search query.
I have the following code at the moment:
function makeRequest() {
var q = $('#query').val();
var request = gapi.client.youtube.search.list({
q: q,
part: 'snippet',
maxResults: 20
});
}
request.execute(function(response) {
$('#results').empty()
var srchItems = response.result.items;
$.each(srchItems, function(index, item){
vidTitle = item.snippet.title;
vidThumburl = item.snippet.thumbnails.default.url;
vidThumbimg = '<pre><img id="thumb" src="' + vidThumburl + '" alt="No Image Available." style="width:102px;height:64px"></pre>';
vidID = item.id.videoId;
$('#results').append('<pre>' + vidTitle + vidThumbimg + vidID+ '</pre>');
})
})
Looking at the last two substantial lines, I thought that the code would be enough to display the videoID as plain text, however, that is not currently working.
Any advice on how to properly display the videoID would be greatly appreciated.

response.result.itemsand show the output for'<pre>' + vidTitle + vidThumbimg + vidID+ '</pre>'this will save me opening up the youtube API and should be able to answer this much quicker. Thank you. Mainly the Json result but maybe I could explain why your vidID isn't displaying.