0

Possible Duplicate:
Handle Browser close in JavaScript?

How to detect a close of a browser using JavaScript or jQuery, I got the window.onbeforeUnload and $(window).unload() of JavaScript and jQuery respectively, but that even gets called on leaving of page,and etc... but I need only and only the close event, nothing else and only that.

1
  • There is no reliable way. I have a solution that detects the user mousing up to the top right direction close button Commented Sep 16, 2011 at 11:43

2 Answers 2

5

Sorry, but this is impossible.

Sign up to request clarification or add additional context in comments.

Comments

1
$(window).unload( 
function () { alert("You Are closing window"); }
);

is that what you mean

2 Comments

alert("...or refreshing the page or going to a link"); Your answer does not answer what the poster wants. [which is impossible]
ok im sorry..my english is bad so i didn't understand him well

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.