View Full Version : onbeforeunload problem

07-04-2005, 04:56 PM
The function closeWin() is being called all of a sudden. I am confused a lot.

<script language="JavaScript">
function closeWin() {
var size = document.body.offsetWidth-32;
if (event.clientY < 0 && event.clientX >= size) {
event.returnValue = false;
event.returnValue = 'Do you want to leave this application?';
return false;
<body onbeforeunload="return closeWin();">

Is there any problem in using event.clientY? Please help.

Willy Duitt
07-04-2005, 06:58 PM