开发者

How to detect a close of a browser using JavaScript or jQuery [duplicate]

This question already has answers here: Closed 11 years ago.

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜