Suppose,closing the browser through Browser Close Button(Top Right Corner cross(x) button), i have to execute some ASP script , for that, in body onUnLoad Event calling a fucntion
called CloseWin(e,frm), it is working in Internet Explorer successfully , But in FireFox not working. how to solve this problem. or any other way to get the co-ordinates of browser close button( code for both IE and Firefox). Please help me in this regard.

thanks in advance .

code follows

function CloseWin(e,frm)
{

//frm required for my program

var bButtonClicked = false;



	if (!e)
	{
		var e=window.event;
	}



	if((e.clientY < -80)) //IE
	{
 		bButtonClicked=true;
			
	}
	else if((e.pageX<0) || (e.pageY<0)) //Fire Fox
	{
		bButtonClicked=true;
		
	}



	if (bButtonClicked==true)
	{

		alert("browser closed!!!");

	}
	else
	{
		alert("browser not closed!!!");
	}

		
}

ASP?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.