Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

140
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda