Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
HunterBoy344 authored Jun 15, 2024
1 parent fcbe253 commit 78eb5b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ function uploadFile() {
}

function sendMessage() {
let messageToSend = input4.value
ws.send(`{ "message" : "${messageToSend.replace(/\"/g,'\\"')}", "username" : "${username.replace(/\"/g,'\\"')}`)
let messageToSend = input4.value.replace(/"/g, '\\"');
ws.send(`{ "message" : "${messageToSend}", "username" : "${username}"`)
input4.value = ""
}

Expand Down

0 comments on commit 78eb5b2

Please sign in to comment.