Get Youtube information via JSON for single video in Javascript - Javascript jQuery

Javascript examples for jQuery:Json

Description

Get Youtube information via JSON for single video in Javascript

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//w ww  .ja  v a2s. c  o m
var video_id='rcLl0A-lXIc';
$.getJSON('http://gdata.youtube.com/feeds/api/videos/'+video_id+'?v=2&alt=jsonc',function(data,status,xhr){
    console.log(data.data.title);
});
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials