Files
Werwolf/index.html
2018-05-01 01:55:56 +02:00

49 lines
2.3 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<title>Werwolf Test page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<style>
input {
width: 100%;
}
</style>
<script>
function send(input, where, server)
{
jQuery.post(server+where, input, function(data, textStatus, jqXHR ){console.log(data); $("#output").html($("#output").html()+JSON.stringify(data)+"<br/>");});
}
$("document").ready(function(){
$("#send").click(function() {send($("#in").val(),$("#where").val(),$("#server").val())});
});
</script>
</head>
<body>
<header>
</header>
<main>
<div style="border:1px solid black; background-color: grey; width: 300px; margin: auto; padding: 10px; border-radius: 10px;">
<h3 style="margin:0px; text-align: center;">Send JSON to Server-Path</h3>
<hr style="width: 320px; padding: 0px; margin-right: -10px; margin-left: -10px; border: none; background-color: black; height: 1px;" />
<form>
<table style="width: 100%;">
<tr><td style="width: 33%; vertical-align: top;"><label>JSON:</label></td><td><textarea id="in" style="width: 100%; min-height: 100px;"></textarea></td></tr>
<tr><td><label>Send to path:</label></td><td><input id="where"/></td></tr>
<tr><td><label>Server:</label></td><td><input id="server" value="http://127.0.0.1:25566/"/></td></tr>
</table>
<button type="button" id="send" style="margin: auto; width: 100%;">SEND</button>
</form>
</div>
<div style="border:1px solid black; background-color: grey; width: min-content; margin: auto; margin-top: 10px; padding: 10px; border-radius: 10px;">
<h3 style="margin:0px; text-align: center;">Answer:</h3>
<hr style="width: 100%; padding: 0px; margin-right: -10px; margin-left: -10px; border: none; background-color: black; height: 1px;" />
<p id="output"></p>
</div>
</main>
<footer>
</footer>
</body>
</html>