Controlar el Cierre del navegador
Publicado por superchuiky (1 intervención) el 22/04/2007 02:44:55
Hola necesito controlar que el nacegador se cierro solo por un link que tengo en la pagina, ya que tengo que realizar operacion en una db antes de cerrar. encontre el siguiente codigo pero no me funciona me podrian decir donde esta la falla Gracias.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
var micierre = false;
function ConfirmarCierre()
{
if (event.clientY < 0)
{
event.returnValue = "";
setTimeout('micierre = false', 100);
micierre = true;
}
}
function ManejadorCierre()
{
if (micierre == true)
{
document.location.href = "../Asia_aut_logout.php";
}
}
</script>
y en el body
<body "onbeforeunload="ConfirmarCierre()" onunload="ManejadorCierre()">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="JavaScript">
var micierre = false;
function ConfirmarCierre()
{
if (event.clientY < 0)
{
event.returnValue = "";
setTimeout('micierre = false', 100);
micierre = true;
}
}
function ManejadorCierre()
{
if (micierre == true)
{
document.location.href = "../Asia_aut_logout.php";
}
}
</script>
y en el body
<body "onbeforeunload="ConfirmarCierre()" onunload="ManejadorCierre()">
Valora esta pregunta


0