Update AB/index.html
Browse files- AB/index.html +9 -10
AB/index.html
CHANGED
@@ -300,17 +300,16 @@ h1 {
|
|
300 |
body: formData
|
301 |
});
|
302 |
if (response.ok) {
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
|
|
|
|
|
|
|
|
308 |
|
309 |
-
} else {
|
310 |
-
// If server error, display the error message
|
311 |
-
const errorMessage = await response.text();
|
312 |
-
resultContainer.innerHTML = `<p>Oops! Something went wrong. Please try again later. </p>`;
|
313 |
-
}
|
314 |
// Hide loading spinner after result (or error message) is displayed
|
315 |
loadingSpinner.style.display = 'none';
|
316 |
estimatedTime.style.display = 'none';
|
|
|
300 |
body: formData
|
301 |
});
|
302 |
if (response.ok) {
|
303 |
+
// If successful response, display the result image
|
304 |
+
const blob = await response.blob();
|
305 |
+
const url = URL.createObjectURL(blob); // Retrieve the URL of the processed image
|
306 |
+
displayResultImage(url); // Pass the URL to the displayResultImage function
|
307 |
+
} else {
|
308 |
+
// If server error, display the error message
|
309 |
+
const errorMessage = await response.text();
|
310 |
+
resultContainer.innerHTML = `<p>Oops! Something went wrong. Please try again later. </p>`;
|
311 |
+
}
|
312 |
|
|
|
|
|
|
|
|
|
|
|
313 |
// Hide loading spinner after result (or error message) is displayed
|
314 |
loadingSpinner.style.display = 'none';
|
315 |
estimatedTime.style.display = 'none';
|