开发者

How to prevent from misclose browsers

I have a Web Application and I want to get a confirmation from users when they are closing the application no matter what.

I mean I'm looking for a way to display a message touser whenever user try to close the application.


Update : I want to use my dialog开发者_运维百科 box not browsers dialogbox. r at least a dialogbox which only shows my message no extra message.


No need for jQuery here, just hook up the window beforeunload event

Demo

window.onbeforeunload = function() {
   return "Are you sure?";
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜