As I would have to alert you to close the browser, I got one, but it also gives the alert when changing the tabs and that's not what I want at the moment ....
Thank you!
As I would have to alert you to close the browser, I got one, but it also gives the alert when changing the tabs and that's not what I want at the moment ....
Thank you!
I do not know if it helps ... but you can use this method ... the only problem is that it will be executed when doing refresh, etc ...
<script type="text/javascript">
window.onbeforeunload = confirmar_saida;
function confirmar_saida()
{
return 'Vamos ter saudades suas!';
}
</script>
Olá! :D
window.location ao clicar em um botão
function redirecionar(){
alert("Você será redirecionado");
window.location="sair.php/";
}
Or
function funcao() {
var r = confirm('Quer mesmo sair?');;
if (r == true) {
window.location.assign("http://www.globo.com") /* ou o seu sair.php */
}
else {
alert('Nao funcionou');
}
return false;
}
<a href="#" onclick="return funcao();">Sair do sistema</a>