server/ui/js/botui.js

19 lines
454 B
JavaScript
Raw Normal View History

2015-08-26 23:15:53 -07:00
$(function(){
$("#error").hide();
if($("#error > div").text() != "") {
$("#error").show();
}
loadGames();
});
function loadGames() {
2015-08-27 21:43:09 -07:00
$.get("/api/v0/game/list/", function(data) {
$("#games").empty();
for (var key in data) {
var name = data[key]["id"];
2015-08-27 22:19:53 -07:00
var s = "<li><a href='/ui/arena/?id=" + name + "'>join</a> " + name + "</li>";
2015-08-27 21:43:09 -07:00
$("#games").append(s);
}
2015-08-26 23:15:53 -07:00
});
}