After triggering a JavaScript alert, is there a way to automatically navigate to the home screen once the alert is closed?
I want users to be redirected to the Home Screen when they press the close button on the alert.
Is there a way to achieve this behavior?
I attempted to add the following code snippet after the alert:
window.location.href = 'index.html'
However, I found that I was instantly redirected before even seeing the alert. What I actually want is to be redirected only after closing the alert.
Below is my attempt:
function sendEmail() {
Email.send({
SecureToken: "a",
To: "b",
From: "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d7b497b0bab6bebbf9b4b8ba">[email protected]</a>",
Subject: "Bestellung",
Body:
"Body"
}).then((message) => alert("Bestellung wird bearbeitet"),
window.location.href = 'index.html');
}