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

136
Visualizações
location.hash not waiting rendering on firefox

I'm using this javascript event.

      myDatepicker.addEventListener('dateChange.mdb.datepicker', (e) => {
        var params = new URLSearchParams(location.search);
        params.set('date', Datepicker1.value.replaceAll('/', "-"));
        window.location.hash = 'graph';
        window.location.search = params.toString();
      });

In chrome everything is working as expected.

In firefox the event doesn't wait for the page to be rendered so it doesn't scroll to the right place. However if I press enter on the url after the event or enter the url manually, it is working as expected.

How can I force firefox to wait until the page rendering is complete?

Max

ps: What I tried following barmar comment with the same result

      redirect = (e) => {
        var params = new URLSearchParams(location.search);
        params.set('date', Datepicker1.value.replaceAll('/', "-"));
        window.location.hash = 'graph';
        window.location.search = params.toString();
      };
      myDatepicker.addEventListener('dateChange.mdb.datepicker', redirect);
      document.addEventListener('load', redirect);

ps2: It seem to be the intended comportment with the reloading of firefox not deleting some elements from the cache that other browser do.

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