Skip to content

Instantly share code, notes, and snippets.

@mathiasose
Created April 14, 2015 20:50
Show Gist options
  • Select an option

  • Save mathiasose/e1c31cddb52b7aa52c3a to your computer and use it in GitHub Desktop.

Select an option

Save mathiasose/e1c31cddb52b7aa52c3a to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="nb">
<head>
<title>Hackerspace NTNU</title>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootswatch/3.3.2/yeti/bootstrap.min.css"/>
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
</head>
<body class="container">
<h1></h1>
<ol></ol>
<script>
$.get("http://localhost:8000/contests/1/", function (data) {
$("h1").html(data.name);
data.results.sort(function (a, b) {
return (data.lowest_best ? -1 : 1) * (b.value - a.value);
});
$(data.results).each(function (i, x) {
$("ol").append("<li><b>" + x.player + "</b>: " + x.value + "</li>")
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment