My problem is this: I have a JSON that returns the API of YouTube and when trying to enter some property I get "undefined"
The Youtube API returns the following:
// Parte del JSON retornado por la API: { "items": [ { "id": { "videoId": "Mfu9jgj_z18", }, "title": "Joey Montana - Hola", "channelTitle": "JoeyMontanaVEVO", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/Mfu9jgj_z18/default.jpg" } } } ] }
And my code is as follows:
$.each(data.items, function (item) {
//URL del video en youtube
html += '<p><a href="http://youtu.be/' + item.id + '">';
alert(html)
//Miniatura del video
html += '<img src="http://i.ytimg.com/vi/' + item.id +'/default.jpg">';
//Agrega el titulo del video y del canal
html += '<h2>' + item.title + ' ' + item.channelTitle + '</h2></a></p>';
count++;
});
So far everything works perfect but when I click on the link it sends me to the page link