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

216
Vistas
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 Respuestas
Responde la pregunta

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 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