diff --git a/plugins/lazyYT/assets/javascripts/lazyYT.js b/plugins/lazyYT/assets/javascripts/lazyYT.js index 747ea69229c..3df9eb1f52a 100644 --- a/plugins/lazyYT/assets/javascripts/lazyYT.js +++ b/plugins/lazyYT/assets/javascripts/lazyYT.js @@ -33,9 +33,11 @@ }) .html('

') .addClass('lazyYT-image-loaded'); - + + var $el_title = $el.find("p.lazyYT-title"); //get reference to the current container title element + $.getJSON('https://gdata.youtube.com/feeds/api/videos/' + id + '?v=2&alt=json', function (data) { - $('#lazyYT-title-' + id).text(data.entry.title.$t); + $el_title.text(data.entry.title.$t); }); $el.on('click', function (e) {