client.js small modernization
This commit is contained in:
parent
4211560f20
commit
e54a4f0b13
|
|
@ -1,5 +1,6 @@
|
||||||
// Constants and variables
|
// Constants and variables
|
||||||
var wsUri = "ws://localhost:8765";
|
const wsUri = "ws://localhost:8765";
|
||||||
|
let websocket;
|
||||||
|
|
||||||
|
|
||||||
// Initialization
|
// Initialization
|
||||||
|
|
@ -21,7 +22,7 @@ function openWebSocket() {
|
||||||
function onOpen(evt) {
|
function onOpen(evt) {
|
||||||
console.log('Connected to ' + wsUri + '.');
|
console.log('Connected to ' + wsUri + '.');
|
||||||
|
|
||||||
text = "Meow";
|
let text = "Meow";
|
||||||
console.log('Sending "' + text + '".');
|
console.log('Sending "' + text + '".');
|
||||||
websocket.send(text);
|
websocket.send(text);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue