title: Getting Youtube Video Information using javascript/jquery
body: <pre><code>    &lt;script type= "text/javascript"&gt;
  var url = "http://gdata.youtube.com/feeds/api/videos/VA770wpLX-Q?v=2&amp;amp;alt=json-in-script&amp;amp;callback=";
  var title;
  var description;
  var viewcount;
  var views;
  var author;
  $.getJSON(url,
      function(data){
          title = data.entry.title.$t;
          description = data.entry.media$group.media$description.$t;
          viewcount = data.entry.yt$statistics.viewCount;
          views = numberFormat (viewcount);
          author = data.entry.author[0].name.$t;
          listInfo (title,description,author,views);
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>So thats my code to get information from a single video, after the info is received it calls this function to display it:</p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
  function listInfo (title,description,author,views) {
      var html = ['&lt;dl&gt;'];
        html.push('&lt;dt&gt;','&lt;span class="titleStyle"&gt;', title,'&lt;/span&gt;&lt;span class="descriptionStyle"&gt;',description, '&lt;/span&gt;&lt;span class="authorStyle"&gt;',author,'&lt;/span&gt;&lt;span class="viewsStyle"&gt;',' Views:',views,'&lt;/span&gt;&lt;/dt&gt;');
  
      html.push('&lt;/dl&gt;');
      document.getElementById("agenda").innerHTML = html.join("");
  }
       function numberFormat(nStr,prefix){
      var prefix = prefix || '';
      nStr += '';
      x = nStr.split('.');
      x1 = x[0];
      x2 = x.length &gt; 1 ? '.' + x[1] : '';
      var rgx = /(\d+)(\d{3})/;
      while (rgx.test(x1))
          x1 = x1.replace(rgx, '$1' + ',' + '$2');
      return prefix + x1 + x2;
  }
    &lt;/script&gt;
  </code></pre>
  
  <p>After that it puts the definition List into a div, which I have inside a table</p>
  
  <pre><code>&lt;table width="485"&gt;&lt;tr&gt;&lt;td&gt;&lt;div id="agenda"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
  </code></pre>
  
  <p>all of this information is found in the body, I can't seem to get it to work, I've been trying for a week now, and I can't find any way to make it work</p>