Skip to content
Snippets Groups Projects
index.ejs 397 B
Newer Older
Nancy Polanyk's avatar
Nancy Polanyk committed
<!DOCTYPE html>
<html>
	<head>
		<title> Plants </title>
	</head>

	<body>
		<h1> Data </h1>
		<p id="data"></p>

		<script src = "https://code.jquery.com/jquery-3.6.0.min.js"></script>
		<script>
			var socket = new WebSocket("ws://localhost:8000);
				socket.onmessage = function(event){
					var data = event.data;
					$("#data").text("Received: " + data);
				};
		</script>
	</body>
</html>