From e54a4f0b1350e01988dcc746736479310902c186 Mon Sep 17 00:00:00 2001 From: Jamie Kerner Date: Sun, 11 Nov 2018 16:23:44 +0100 Subject: [PATCH] client.js small modernization --- public_html/js/client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public_html/js/client.js b/public_html/js/client.js index 7887471..741b554 100644 --- a/public_html/js/client.js +++ b/public_html/js/client.js @@ -1,5 +1,6 @@ // Constants and variables -var wsUri = "ws://localhost:8765"; +const wsUri = "ws://localhost:8765"; +let websocket; // Initialization @@ -21,7 +22,7 @@ function openWebSocket() { function onOpen(evt) { console.log('Connected to ' + wsUri + '.'); - text = "Meow"; + let text = "Meow"; console.log('Sending "' + text + '".'); websocket.send(text); }