Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script>
  4. var ws = new WebSocket('ws://localhost:8080');
  5. ws.onmessage = function (event) {
  6. document.getElementById('result0').value=event.data;
  7. }
  8. </script>
  9. </head>
  10. <body>
  11. <p>
  12. Result: <output type="text" id="result0" value="" readonly></output>
  13. </p>
  14.  
  15. <input type="text" onchange="ws.send(this.value); ")>
  16. <button type="submit" onclick="ws.send('Clicked');" value="Click">Click</button>
  17. </body>
  18. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement