From b4140460014d1fc134df9127600f6da2346376e3 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Tue, 20 Aug 2024 17:34:18 -0700 Subject: init commit with base ECS and Network System --- static/index.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'static/index.js') diff --git a/static/index.js b/static/index.js index 2c8ed38..ad39c4f 100644 --- a/static/index.js +++ b/static/index.js @@ -1,5 +1,12 @@ window.onload = () => { - console.log('from js'); - const kennelWindowEle = document.querySelector('#kennel-window'); - kennelWindowEle.innerHTML = 'rendered from static/index.js'; -} + const ws = new WebSocket("/ws"); + ws.onopen = () => { + console.log("connected"); + }; + ws.onmessage = (e) => { + console.log(e); + }; + ws.onclose = (e) => { + console.log("disconnected", e); + }; +}; -- cgit v1.3