That's the window.onbeforeunload event. Use it like this: window.onbeforeunload = function() { return "Unsaved changes will be lost."; };
You can't use regular jQuery event binding for onbeforeload. See her: http://dev.jquery.com/ticket/1365 --Erik On 9/25/07, Trans <[EMAIL PROTECTED]> wrote: > > > > > On Sep 24, 12:53 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > > Try $(window).unload(...). Works for me on firefox. I think these docs > are > > wrong:http://docs.jquery.com/Events/unload#fn > > Thanks. That worked for when the window changes or redirects. > > Is there anyway to detect a browser window being closed? > > T. > >