Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 7th, 2012  |  syntax: jQuery  |  size: 1.16 KB  |  hits: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $('document').ready(function(){
  2.                
  3.                 $('.button').click(function(){
  4.                    
  5.                     var link = $('.test').val();
  6.                     $.youtube({
  7.                         'url': link,
  8.                         'success': function(data){
  9.                             var embed = $.youtube('getPlayer', data.id, 'small');
  10.                             var title = "<h1>" + data.title + "</h1> <br />";
  11.                             var description = "<h4>" + data.description + "</h4><br />";
  12.                             var thumbs = "";
  13.                            
  14.                             $.each(data.thumbnail.album, function(index, value){
  15.                                thumbs += "<img src='" + value + "' /> ";
  16.                             });
  17.                            
  18.                             console.log(thumbs);
  19.                             $('#video').html(title  + description + thumbs + '<br /><br />' + embed);
  20.                             //$('#video').append("<img src='" + data.thumbnail['hqDefault'] + "' />");
  21.                         }
  22.                     });
  23.                 });
  24.             });