Permalink
Browse files

Updated the example appropriately

  • Loading branch information...
1 parent 5cd905b commit 8479a297459db88aad5609b12af7d099232c2e22 James committed Jun 22, 2011
Showing with 9 additions and 12 deletions.
  1. +9 −12 index.html
View
@@ -7,24 +7,21 @@
<script type="text/javascript" src="jquery.yt-api.js"></script>
<script type="text/javascript">
- // We'll use a NIN video for this.
- var youtubeUrl = "http://www.youtube.com/watch?v=-HbKaHddmfU";
/*
- * The following will output the description of the video,
- * which is 'NIN - Closer'. I'm a big NIN fan.
+ * The following will output the description of the video. I'm a big NIN fan.
*/
-
- var ytObj = new YtApi(youtubeUrl);
- console.log(ytObj.get('description'));
+
+ YtApi("http://www.youtube.com/watch?v=ccY25Cb3im0", function (data) {
+ console.log(data.get('description'));
+ });
/*
- * You could even just do this:
+ Essentially what we just did here was make a call to YouTube and passed
+ a function to run upon completion. We do it this way now so that it
+ becomes a non-blocking operation meaning that it won't make everything
+ wait until it's done.
*/
-
- console.log(
- new YtApi(youtubeUrl).get('description')
- );
</script>
</head>
<body>

0 comments on commit 8479a29

Please sign in to comment.