This commit is contained in:
2023-08-13 14:42:52 +03:00
parent eb0c143166
commit 2dd03e4d2f
3 changed files with 12 additions and 10 deletions

View File

@@ -39,14 +39,13 @@
// }
// }
// var i = 0
window.onload = function (){
let user_id = document.querySelector(".button_profile_header").dataset['userId']
let url = `ws://localhost:8000/ws/socket-server/?user_id=${user_id}`;
const chatSocket = new WebSocket(url);
}
url = `ws://localhost:8000/ws/socket-server/?user_id=${user_id}`;
const chatSocket = new WebSocket(url);
function sendMessageSocket (data) {
chatSocket.send(JSON.stringify(data));
}
@@ -103,5 +102,4 @@ chatSocket.onmessage = function (e) {
// // btn.reset()
// })
// }
// let form = document.getElementById('form')
// let form = document.getElementById('form')