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

80
Vistas
On location.href redirect to # parameter execute code

This question is similar to this one, but my redirect is to the same page, but a #parameterhere. For example I am in example.com and the location.href changes to example.com/#1 and then example.com/#2 and so on as time goes.

I wrote this function:

window.onload = function () {
    header.classList.remove("sticky");
};

But it does not execute because the DOM is not reloaded... How do I execute this code after the internal URL changes?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use the onhashchange event handler (MDN):

window.onhashchange = function () {
    header.classList.remove("sticky");
};
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