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

213
Visualizações
When I press the browser back button or mouse back button the Javascript seems to be cached in Wordpress and it doesn't execute the code

Whenever I press the back button on https://automotive-electronics.nl the page loader does not hide. I have found out that this is caused because the javascript seems to be cached (if there is such a thing). I have added a console log at the top of the javascript file, which logs "test" to the JS console. Whenever I load the page normally it logs "test". When clicking a link it also logs test and when going back it still logs test, so everything seems fine. However, something weird happens when going back:

To me it seemed like the logging in the console was instantly, hence I felt like something was wrong so I tried the following:

  1. Go to the home page -> test is logged, so this is fine
  2. Clear the JS console -> test is not logged anymore, which makes sense as I have just cleared the console
  3. Go to any page other than the home page -> test is logged, which is fine
  4. Press either the browser of mouse back button which will take you back to the homepage -> test is NOT logged, which is not fine

Since test is logged when not clearing the console and test is not logged when clearing the console, this leads me to believe that the JS is cached somehow, however, I do not know how to fix this issue. I have also found that this does not happen 100% of the time, but it does happen way too often. I am using Google Chrome to test things. Is anyone able to help me? Thanks in advance :)

UPDATE: After some testing it seems to only happen when both the initial page, and the second page have been visited recently (I'm assuming they should both be in your cache in order to work).

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

If anyone else is running into this problem; I have fixed it by adding window.onunload = function(){}; to the first line of the file, as suggested in After travelling back in Firefox history, JavaScript won't run. Thanks to mplungjan for taking the time to look into the issue with me!

about 4 years ago · Juan Pablo Isaza Relatório
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