|
|
@@ -65,9 +65,9 @@ window.addEventListener("load", function(evt) {
|
|
|
var ws;
|
|
|
|
|
|
var print = function(message) {
|
|
|
- var p = document.createElement("p");
|
|
|
- p.innerHTML = message;
|
|
|
- output.appendChild(p);
|
|
|
+ var d = document.createElement("div");
|
|
|
+ d.innerHTML = message;
|
|
|
+ output.appendChild(d);
|
|
|
};
|
|
|
|
|
|
document.getElementById("open").onclick = function(evt) {
|
|
|
@@ -112,13 +112,21 @@ window.addEventListener("load", function(evt) {
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
+<table>
|
|
|
+<tr><td valign="top" width="50%">
|
|
|
+<p>Click "Open" to create a connection to the server,
|
|
|
+"Send" to send a message to the server and "Close" to close the connection.
|
|
|
+You can change the message and send multiple times.
|
|
|
+<p>
|
|
|
<form>
|
|
|
<button id="open">Open</button>
|
|
|
<button id="close">Close</button>
|
|
|
<p><input id="input" type="text" value="Hello world!">
|
|
|
<button id="send">Send</button>
|
|
|
</form>
|
|
|
+</td><td valign="top" width="50%">
|
|
|
<div id="output"></div>
|
|
|
+</td></tr></table>
|
|
|
</body>
|
|
|
</html>
|
|
|
`))
|