Update chatroom.HTML
This commit is contained in:
parent
23d82fb111
commit
a27ee7f362
1 changed files with 0 additions and 3 deletions
|
@ -45,8 +45,6 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
function sendMessage(message) {
|
function sendMessage(message) {
|
||||||
// Here, you would typically send the message to your server using an AJAX request
|
|
||||||
// For demonstration purposes, we'll just add the message locally
|
|
||||||
messages.push(message);
|
messages.push(message);
|
||||||
updateChatbox();
|
updateChatbox();
|
||||||
}
|
}
|
||||||
|
@ -65,7 +63,6 @@
|
||||||
// Polling with a 3-second interval
|
// Polling with a 3-second interval
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
// Perform an AJAX request to the server to get new messages
|
// Perform an AJAX request to the server to get new messages
|
||||||
// Replace the URL with the appropriate endpoint on your server
|
|
||||||
fetch('/getNewMessages')
|
fetch('/getNewMessages')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue