first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button>点我</button>
</body>
<script>
var socket = new WebSocket("ws://127.0.0.1:8080");
socket.onopen =function (event) {
console.log("onopen: ","和服务器建立连接")
}
socket.onmessage = function (event) {
console.log("onmessage: ",event.data)
}
socket.onclose = function (event) {
console.log("onclose: ","和服务器连接关闭")
}
socket.onerror = function(event) {
console.log("onerror: ", event)
};
document.querySelector("button").onclick = function () {
socket.send("你好啊哈哈哈哈哈哈")
}
</script>
</html>