views:

27

answers:

2

I know how to show an alert when the user exits the browser and I know how to implement a neat modal dialog using the jQuery UI library. My problem is, I'd like to implement that dialog when the user attempts to close the browser rather than display the ugly little popup box. Is this do-able?

A: 

Have you tried handling the window.close() event?

Jason Summers
can i use that in conjunction with jQuery though?
Matt
A: 

Nope, sorry, that's by design. It keeps people from writing nasty things that keeps the page from being closed.

CAbbott
makes sense I suppose. But if you're developing an intranet app it would be nice. Thanks for the head's up.
Matt