not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
648 B

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Hello world</title>
  5. </head>
  6. <script src = "../../socket.io/socket.io.js"></script>
  7. <script>
  8. var socket = io();
  9. socket.emit('register', 'jeff');
  10. socket.on('sendRooms', function(data)
  11. {
  12. console.log("got rooms");
  13. console.log(data);
  14. //document.write(data);
  15. data.rooms.forEach(function(r)
  16. {
  17. document.write(r.name)
  18. document.write("<br />");
  19. });
  20. var tt = new Object();
  21. tt.roomName = "den";
  22. tt.password = "pp";
  23. socket.emit('joinRoom', tt);
  24. });
  25. </script>
  26. <body>Hello world</body>
  27. </html>