Skip to content

Instantly share code, notes, and snippets.

@erjjones
Created March 7, 2012 21:36
Show Gist options
  • Save erjjones/1996394 to your computer and use it in GitHub Desktop.
Save erjjones/1996394 to your computer and use it in GitHub Desktop.
Bad Example: Get Git Hub Account Information (Ajax)
jQuery(document).ready(function() {
$('#gf').text('GitHub Followers');
$('#gfr').text('GitHub Repos');
$.get('https://api.github.com/users/erjjones', function(res) {
var obj = jQuery.parseJSON(res);
if(typeof obj.followers != 'undefined')
{
$('#gf').text(obj.followers + ' GitHub Followers');
$('#gfr').text(obj.public_repos + ' GitHub Repos');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment