我已經嘗試了下面的代碼提到的目的,但這不是在mozila中工作,而且我在確認框中獲得一些額外的行。在瀏覽器上獲取確認框關閉
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> <title>Coordinates!</title>
<script type="text/javascript">
var myclose = false;
function ConfirmClose()
{
if (event.clientY < 0)
{
event.returnValue = 'Any message you want';
setTimeout('myclose=false',100);
myclose=true;
}
}
function HandleOnClose()
{
if (myclose==true)
alert("Window is closed");
}
</script>
</head> <body onbeforeunload="ConfirmClose()" onunload="HandleOnClose()" ><a href="#">test</a> </body></html>
請問您能爲mozila建議些什麼。
請修復格式和拼寫。 – Migol 2011-01-12 09:45:26