Hi Abdul,
Its working fine but i have one small query exactly what im trying to do is when the user is closing the window i want capture some details and pass it to the DB.
when im using the above function it always gives me the alert, it works fine if im using window.onbeforeunload when not used with jquery.
can you suggest me any other idea.
I have tried with the following code
<pre lang="cs">$(document).ready(function() {
$(window).unload(function() {
var clientx = window.event.clientX;
var clienty = window.event.clientY;
if ((clientx > 0) || (clienty < 0)) {
var c = confirm("do you want to close the window");
if (!c) { window.focus(); } else { alert("Thank you for your visit"); }
}
});
});