Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda