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

285
Vistas
How to prevent jumping to top of the page when clicking on a link?

I have been stuck on how to prevent jumping to the top of the page when clicking on a link that has parsing PHP data.

I have tried so many things, like preventDefault or return false or putting "/" at the end, but unfortunately with no success. Observation: this is linking to the same page, but is sending a php value.

The link looks like this:

<a id="chatLink" href="explore.php?user_id=<?php echo $row['unique_id']?>"
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First you need to store scrollValue before leaving page:

window.onscroll = e => localStorage.setItem('scrollTop', document.body.scrollTop);

Then, when new page load, set scroll back:

window.onload = e => {
    const scrollTop= localStorage.getItem('scrollTop');
    document.body.scrollTop = scrollTop;
}
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