How to detect a close of a browser using JavaScript or jQuery [duplicate]
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.
Sorry, but this is impossible.
$(window).unload(
function () { alert("You Are closing window"); }
);
is that what you mean
精彩评论