Advertisement
Guest User

Untitled

a guest
Jan 16th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.40 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3.   <head>
  4.     <title>Count</title>
  5.  
  6.     <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  7.  
  8.     <script>
  9.       const socket = new WebSocket('ws://localhost:9000')
  10.  
  11.       socket.onmessage = function(count) {
  12.           $('#count').text(count.data);
  13.       };
  14.  
  15.     </script>
  16.  
  17.   </head>
  18.   <body>
  19.     Count: <span id="count">no data yet</span>
  20.   </body>
  21. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement