-
-
Save felquis/1233083 to your computer and use it in GitHub Desktop.
Youtube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
//inicio o jquery | |
$(document).ready(function(){ | |
$.ajax({ | |
url: "http://gdata.youtube.com/feeds/base/users/videosimprovaveis/uploads?orderby=updated&v=2&alt=json", | |
dataType: "jsonp", | |
success: function(data){ | |
console.log('SUCESSO'); | |
console.log(data); | |
var html = ''; | |
var i = 0; | |
while(i < data.results.length) | |
{ | |
var titulo = data.results[i].title; | |
var user = data.results[i].author; | |
html ="<p>"+titulo+"</p>"; | |
html +="<p>"+user+"</p>"; | |
i++; | |
} | |
$('#youtube').html(html); | |
}, | |
error : function(a , b){ | |
console.log('ERRO'); | |
console.log(a, b); | |
} | |
}); | |
}); | |
</script> | |
<div id="youtube"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment