Added loading indicator to js.

This commit is contained in:
Andrew Lalis 2023-07-16 12:34:13 -04:00
parent df8a6dd192
commit 3d194eb2a0
1 changed files with 1 additions and 3 deletions

View File

@ -2,10 +2,8 @@ const form = document.getElementById("schematic-form");
const resultContainer = document.getElementById("result-container"); const resultContainer = document.getElementById("result-container");
form.onsubmit = async (e) => { form.onsubmit = async (e) => {
e.preventDefault(); e.preventDefault();
resultContainer.innerHTML = ""; resultContainer.innerHTML = "<p>Uploading and extracting contents...</p>";
console.log(e);
const data = new FormData(form); const data = new FormData(form);
console.log(data);
try { try {
const response = await fetch("/extracts", { const response = await fetch("/extracts", {
method: "POST", method: "POST",