server/ui/js/botui.js
2015-08-27 22:29:50 -07:00

19 lines
454 B
JavaScript

$(function(){
$("#error").hide();
if($("#error > div").text() != "") {
$("#error").show();
}
loadGames();
});
function loadGames() {
$.get("/api/v0/game/list/", function(data) {
$("#games").empty();
for (var key in data) {
var name = data[key]["id"];
var s = "<li><a href='/ui/arena/?id=" + name + "'>join</a> " + name + "</li>";
$("#games").append(s);
}
});
}