Update public/index.html
Browse files- public/index.html +2 -2
public/index.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
-
<title>HugVPS Chat - Connected</title>
|
| 7 |
<style>
|
| 8 |
ul { list-style-type: none; padding: 0; }
|
| 9 |
li { padding: 8px; margin-bottom: 10px; background: #f1f1f1; }
|
|
@@ -61,7 +61,7 @@
|
|
| 61 |
// Listen for chat messages
|
| 62 |
socket.on('chat message', function(data) {
|
| 63 |
const item = document.createElement('li');
|
| 64 |
-
item.
|
| 65 |
messages.appendChild(item);
|
| 66 |
window.scrollTo(0, document.body.scrollHeight);
|
| 67 |
});
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>HugVPS Chat - Connected to server</title>
|
| 7 |
<style>
|
| 8 |
ul { list-style-type: none; padding: 0; }
|
| 9 |
li { padding: 8px; margin-bottom: 10px; background: #f1f1f1; }
|
|
|
|
| 61 |
// Listen for chat messages
|
| 62 |
socket.on('chat message', function(data) {
|
| 63 |
const item = document.createElement('li');
|
| 64 |
+
item.innerHTML = `${data.username}: ${data.message}`;
|
| 65 |
messages.appendChild(item);
|
| 66 |
window.scrollTo(0, document.body.scrollHeight);
|
| 67 |
});
|