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

144
Vistas
Close site on user click on div

I want my website to be closed on a custom close div or button. That's because the page may have many previous pushShates so clicking the browsers back button will take to the previous page. So, I want when user clicks the button my website will close.

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

0

window.close(); 

Should close the current tab which the user sees. It only closes the current tab though. Add this as an event to your div and when the user click on it, it would close the current window.

about 4 years ago · Juan Pablo Isaza Denunciar

0

If you're talking about closing your current tab then you can just use the function below.

window.close();

Just use a workaround through redirecting the window to something else cause this problem is pretty self-explanatory, it doesn't allow closing window that is not opened by it through JS. There's nothing can be done so use the method below

window.location.href = 'your redirection here';
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