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

137
Vistas
Redirect after Firebase Write

I am looking to redirect to another page after a document has been written to firebase, what would be the best way of doing this? At the moment, I have something that looks like this:

var scoreRef = firebase.database().ref('scores');
scoreRef.push(myObj).then(() => {

  document.location.href = "index.html";

});

I am using push to get a unique Id.

EDIT: Is there enough time for it to write to Firebase before it redirects?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

if you are using vanilla js than

location.href="URL"
  or
location.replace("URL")
  or
location.assign("URL")

are the three properties you can use.

about 4 years ago · Santiago Trujillo 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