You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
615 B
JavaScript
29 lines
615 B
JavaScript
window.addEventListener("load", function () {
|
|
fetch("http://localhost:3000/flasher/getProjects", {
|
|
method: "POST",
|
|
body: "body",
|
|
headers: {
|
|
// "Content-Type": "multipart/form-data",
|
|
// "content-type": "text/html; charset=utf-8",
|
|
},
|
|
})
|
|
.then(function (res) {
|
|
console.log(res);
|
|
})
|
|
.catch((err) => ("Error occured", err));
|
|
});
|
|
|
|
var socket = io();
|
|
|
|
socket.on("test", (s) => {
|
|
console.log(s);
|
|
});
|
|
|
|
form.addEventListener("submit", function (e) {
|
|
e.preventDefault();
|
|
if (input.value) {
|
|
socket.emit("chat message", input.value);
|
|
input.value = "";
|
|
}
|
|
});
|