server 3 holy shit
This commit is contained in:
25
templates/test.html
Normal file
25
templates/test.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Live Update</title>
|
||||
<script src="https://cdn.socket.io/4.6.1/socket.io.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Daten vom Server</h2>
|
||||
<p><strong>Test:</strong> <span id="test"></span></p>
|
||||
<p><strong>Status:</strong> <span id="status"></span></p>
|
||||
<p><strong>Counter:</strong> <span id="counter"></span></p>
|
||||
|
||||
<script>
|
||||
const socket = io();
|
||||
|
||||
socket.on('update_data', (data) => {
|
||||
document.getElementById('test').textContent = data.test;
|
||||
document.getElementById('status').textContent = data.status;
|
||||
document.getElementById('counter').textContent = data.counter;
|
||||
console.log('Neue Daten:', data);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user