Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- var ws = new WebSocket('ws://localhost:8080');
- ws.onmessage = function (event) {
- document.getElementById('result0').value=event.data;
- }
- </script>
- </head>
- <body>
- <p>
- Result: <output type="text" id="result0" value="" readonly></output>
- </p>
- <input type="text" onchange="ws.send(this.value); ")>
- <button type="submit" onclick="ws.send('Clicked');" value="Click">Click</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement