websocket 增加多分组 fork https://github.com/olahol/melody
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.

34 lines
677 B

  1. <html>
  2. <head>
  3. <title>Melody example: chatting</title>
  4. </head>
  5. <style>
  6. #chat {
  7. text-align: left;
  8. background: #f1f1f1;
  9. width: 500px;
  10. min-height: 300px;
  11. padding: 20px;
  12. }
  13. </style>
  14. <body>
  15. <center>
  16. <h3>Join a channel</h3>
  17. <input placeholder="channel" id="channel" type="text"><button id="join">Join</button>
  18. </center>
  19. <script>
  20. var chan = document.getElementById("channel");
  21. var join = document.getElementById("join");
  22. join.onclick = function () {
  23. if (chan.value != "") {
  24. window.location = "/channel/" + chan.value;
  25. }
  26. };
  27. </script>
  28. </body>
  29. </html>