Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

284
Vistas
On Close of Alert Window navigate to HomeScreen JavaScript

Is there a way to navigate to the home screen when a js alert is closed?

So I have triggered an alert

.then((message) => alert("Bestellung wird bearbeitet")

& I want that you get redirected to the Home Screen when you press on the close button.

Is there a way to accomplish this behaviour?

I tried adding

window.location.href = 'index.html'

after the alert button, but I get redirected instantly, so the alert button doesn't even appear. But I want to be redirected after the alert button is closed.

The attempt:

function sendEmail() {
    Email.send({
      SecureToken: "a",
      To: "b",
      From: "c@gmail.com",
      Subject: "Bestellung",
      Body:
        "Body"
    }).then((message) => alert("Bestellung wird bearbeitet"), 
    window.location.href = 'index.html');
  }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As stated here the second arguments passed to then() it's the handler for the rejected case. You were passing a second argument using , instead of wrapping a sequence of statements in the closure function body.

This is the way for the second instruction to be executed after the user closed the alert dialog:

.then((message) => {
  alert("Bestellung wird bearbeitet");
  window.location.href = 'index.html';
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda