Created
March 7, 2012 21:36
-
-
Save erjjones/1996394 to your computer and use it in GitHub Desktop.
Bad Example: Get Git Hub Account Information (Ajax)
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
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