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

208
Vistas
Various JS reload page instructions failing if not preceeded by console.log()

Just wanted to report possible JS bug: I tried various reload page instructions but they all fail most times. However, the problem seems "resolved" by adding a console.log() line before. Is this a normal JS behaviour? My problematic code chunk is the following:

myForm.addEventListener('submit', (event) => {
                let fields = [verifyPassword, updateText];
                if (fields.some(field=>(field.value === '' || field.value === null || field.value === NaN))){
                    event.preventDefault();
                    alert('Fill in the form!');
                } else {
                    console.log("Now this page should reload..."); // if this line is removed, reload functions work rarely
                    document.location.reload(true); // same happens with history.go(0) etc.
                };
            });
about 4 years ago · Juan Pablo Isaza
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