Created
March 17, 2013 09:18
-
-
Save Mailaender/5180786 to your computer and use it in GitHub Desktop.
OpenRA Master Server server list display
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>OpenRA Master Server</title> | |
</head> | |
<body> | |
<h1>OpenRA Master Server</h1> | |
<div id="list"></div> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="json2.js"></script> | |
<script type="text/javascript" src="handlebars-0.9.0.pre.5.js"></script> | |
<script id="serverlist-template" type="text/x-handlebars-template"> | |
<ul> | |
{{#each games}} | |
<li>{{name}} ({{id}})</li> | |
{{/each}} | |
</ul> | |
</script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
// compile our template | |
var template = Handlebars.compile($("#serverlist-template").html()); | |
var games = { "games": [] }; | |
var data = $.get("list_json.txt", function() { | |
alert("success"); | |
$.extend(games, data); | |
}) | |
$('#list').html(template(games)); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment