Blame view

code/client.html 387 Bytes
1f34ee88   Lars Tiede   after presentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  <html>
  <body>
  <p id="output_number"></p>
  </body>
  
  <script type="text/javascript">
  window.onload = function() {
      var out = document.getElementById("output_number");
      var ws = new WebSocket("ws://localhost:4040/ws_demo");
  
      ws.onopen = function() {
          ws.send("1000");
      };
  
      ws.onmessage = function(msg) {
          out.innerHTML = msg.data;
      };
  };
  </script>
  
  </html>