Skip to content

Instantly share code, notes, and snippets.

@iesta
Last active November 23, 2015 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iesta/78943b4215b9aad802bb to your computer and use it in GitHub Desktop.
Save iesta/78943b4215b9aad802bb to your computer and use it in GitHub Desktop.
<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> heb <span class="luckyvalue"> ' + val.value + "&euro;" + ' gewonnen</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