0

I put it all here: http://jsfiddle.net/uJ3h7/

But I'll repost the mark-up here:

$(document).ready(function(){
$.getJSON("http://gdata.youtube.com/feeds/api/users/MisterAngelMarino/favorites?v=2&alt=jsonc&max-results=1",function(json){
$.each(json.data, function(i,video){
var source = video.id
$("#video").append('<iframe width="560" height="349" src="http://www.youtube.com/embed/'+ source + '?html5=1&theme=dark&showinfo=0&modestbranding=1&controls=0" allowfullscreen></iframe>');    
    });
});
});



<div id="video"></div>

Any ideas what I borked?

TonySalimi
  • 8,257
  • 4
  • 33
  • 62
Angel Marino
  • 95
  • 1
  • 9

1 Answers1

0

This should work:

http://jsfiddle.net/pKZPP/

stewe
  • 41,820
  • 13
  • 79
  • 75
  • Wow, thanks! :D I think I can see what I did wrong, but would you mind elaborating? Basically when you parse JSON results you have to include the entire string? – Angel Marino Aug 22 '11 at 03:05
  • You could use a variable to shorten things: http://jsfiddle.net/BqMmU/ or in your case (max-results=1) you dont even need a loop: http://jsfiddle.net/P22vh/ – stewe Aug 22 '11 at 03:38