Last active
November 23, 2015 16:07
-
-
Save iesta/8b124e73f0d204b1d3e6 to your computer and use it in GitHub Desktop.
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
<div id="luckyleaderboard"></div> | |
<style>ul.luckywinners { | |
list-style-type: none; | |
padding-left:0px; | |
} | |
ul.luckywinners li { | |
border: #dddddd 1px solid; | |
padding: 10px; | |
margin-bottom: 4px; | |
padding-left:0px; | |
text-align:center; | |
} | |
.luckyname { | |
font-weight: bold | |
} | |
.luckyvalue { | |
font-weight: bold | |
} | |
</style> | |
<script> | |
$.getJSON("https://www.luckycycle.com/operations/3d9ca30bae0a3e8882dfde05c7d00ec2/board.json", function (data) { | |
var items = []; | |
$.each(data, function (key, val) { | |
console.log("pop"); | |
if (val.firstname) { | |
items.push('<li><span class="luckyname">' + val.firstname + " " + val.lastname.charAt(0) + '</span> a gagné <span class="luckyvalue"> ' + val.value + "€" + '</span></li>'); | |
} | |
}); | |
$("<ul/>", { "class": "luckywinners", html: items.join("") }).appendTo("#luckyleaderboard"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment