Update public/index.html
Browse files- public/index.html +2 -2
public/index.html
CHANGED
|
@@ -71,11 +71,11 @@
|
|
| 71 |
// Listen for chat messages
|
| 72 |
socket.on('chat message', function(data) {
|
| 73 |
const item = document.createElement('li');
|
| 74 |
-
item.
|
| 75 |
messages.appendChild(item);
|
| 76 |
window.scrollTo(0, document.body.scrollHeight);
|
|
|
|
| 77 |
});
|
| 78 |
-
twemoji.parse(document.body);
|
| 79 |
console.log("[CHAT] Connected to socket.io server")
|
| 80 |
</script>
|
| 81 |
</body>
|
|
|
|
| 71 |
// Listen for chat messages
|
| 72 |
socket.on('chat message', function(data) {
|
| 73 |
const item = document.createElement('li');
|
| 74 |
+
item.innerText = `${data.username}: ${data.message}`;
|
| 75 |
messages.appendChild(item);
|
| 76 |
window.scrollTo(0, document.body.scrollHeight);
|
| 77 |
+
twemoji.parse(document.body);
|
| 78 |
});
|
|
|
|
| 79 |
console.log("[CHAT] Connected to socket.io server")
|
| 80 |
</script>
|
| 81 |
</body>
|