mirror of
https://github.com/klaussilveira/gitlist.git
synced 2026-04-14 08:28:09 +02:00
Fixing problem with getJSON(), using ajax() instead. Damn you, JSONP.
This commit is contained in:
24
js/main.js
24
js/main.js
@@ -1,16 +1,20 @@
|
||||
$(function(){
|
||||
$.getJSON('https://api.github.com/repos/klaussilveira/gitlist/contributors', function(data) {
|
||||
var items = [];
|
||||
$.ajax({
|
||||
url: 'https://api.github.com/repos/klaussilveira/gitlist/contributors',
|
||||
dataType: 'jsonp',
|
||||
success: function(data) {
|
||||
var items = [];
|
||||
|
||||
$.each(data, function(key, val) {
|
||||
items.push('<li><a href="' + val.url + '" rel="avatarover" data-placement="top" data-title="' + val.login + '" data-content="' + val.login + ' has made ' + val.contributions + ' contributions to GitList"><img src="' + val.avatar_url + '" width="32" height="32" /></a></li>');
|
||||
});
|
||||
$.each(data.data, function(key, val) {
|
||||
items.push('<li><a href="' + val.url + '" rel="avatarover" data-placement="top" data-title="' + val.login + '" data-content="' + val.login + ' has made ' + val.contributions + ' contributions to GitList"><img src="' + val.avatar_url + '" width="32" height="32" /></a></li>');
|
||||
});
|
||||
|
||||
$('<ul/>', {
|
||||
'class': 'contributor-list',
|
||||
html: items.join('')
|
||||
}).appendTo('#contributors');
|
||||
$('[rel=avatarover]').popover();
|
||||
$('<ul/>', {
|
||||
'class': 'contributor-list',
|
||||
html: items.join('')
|
||||
}).appendTo('#contributors');
|
||||
$('[rel=avatarover]').popover();
|
||||
}
|
||||
});
|
||||
|
||||
$('[rel=carousel]').carousel();
|
||||
|
||||
Reference in New Issue
Block a user