Skip to content

Instantly share code, notes, and snippets.

@kenshub
Created July 28, 2014 18:01
Show Gist options
  • Save kenshub/27c0398dfd054bed1bbc to your computer and use it in GitHub Desktop.
Save kenshub/27c0398dfd054bed1bbc to your computer and use it in GitHub Desktop.
JSONP Example
<script>
$(document).ready(function(){
$.getJSON('https://api.github.com/gists?callback=?', function(response){
$.each(response.data, function(i, gist){
$('#gists').append('<li>' + gist.user.login + " (<a href='" + gist.html_url + "'>" +
(gist.description == "" ? "undescribed" : gist.description) + '</a>)</li>');
});
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment