-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
21 lines (19 loc) · 716 Bytes
/
Copy pathscript.js
File metadata and controls
21 lines (19 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
document.addEventListener("DOMContentLoaded", function () {
const uploadButton = document.getElementById("uploadButton");
const uploadForm = document.getElementById("uploadForm");
const message = document.getElementById("message");
uploadButton.addEventListener("click", function () {
const formData = new FormData(uploadForm);
fetch("https://doesnte235246.000webhostapp.com/new.php", {
method: "POST",
body: formData
})
.then(response => response.text())
.then(data => {
message.textContent = data;
})
.catch(error => {
message.textContent = "Error: " + error.message;
});
});
});