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

<html>
<head>
<title>Melody example: chatting</title>
</head>
<style>
#chat {
text-align: left;
background: #f1f1f1;
width: 500px;
min-height: 300px;
padding: 20px;
}
</style>
<body>
<center>
<h3>Join a channel</h3>
<input placeholder="channel" id="channel" type="text"><button id="join">Join</button>
</center>
<script>
var chan = document.getElementById("channel");
var join = document.getElementById("join");
join.onclick = function () {
if (chan.value != "") {
window.location = "/channel/" + chan.value;
}
};
</script>
</body>
</html>