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

181
Vistas
How to stay on the Current Page in JavaScript after refresh

guys!

I am working on a project with Java + Javascript and when I refresh the page instead of staying in my home page, it's redirecting to login page.

I'm new to this and want to know how can I stay on same page after refreshing. I read some examples but it's not clear how to achieve this.

Example: if I'm in Settings page and press F5 or reloa, I wanna stay in Settings Page.

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

0

.preventDefault can be used on event listeners to avoid refreshing The event listener can be anything that causes the refresh

about 4 years ago · Juan Pablo Isaza Denunciar

0

Typically location.reload(); would be used to refresh to the same URL, but your application logic might only allow access to particular URLs after going through certain other steps - e.g. logging in.

Without more information, your question will be almost impossible to answer.

You should try to figure out the steps that your application goes through during a bootstrap (i.e. start-up), as refreshing in a web app is effectively a restart of the JavaScript application.

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