[jQuery] Detect browser close event

2007-01-19 Thread Unai Martinez
How can i detect browser close event? I've tried something like: $(window).unload( function(){ alert("close"); //stop event return false; } ); Alert appears, but event continues... Thx! -- Unai Martinez [EMAIL PROTECTED] http://helusin

Re: [jQuery] Detect browser close event

2007-01-19 Thread Unai Martinez
I want to attach an event on close to verify that all changes made on a form are saved. Something like in gmail, if you try close browser window when you are composing an email, you get a dialog. Thx. On 1/19/07, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > Unai Martinez schr

Re: [jQuery] Detect browser close event

2007-01-19 Thread Unai Martinez
I get it working, without jquery :: window.onbeforeunload = function(){return "Unsaved changes."} Thx. On 1/19/07, David Duymelinck <[EMAIL PROTECTED]> wrote: Unai Martinez schreef: > How can i detect browser close event? > > I've tried something like: >

Re: [jQuery] Detect browser close event

2007-01-19 Thread Unai Martinez
niConfirm() is just a unicode-safe version of confirm() jQuery(".crayon-changed") is the list of unsaved items, and their associated forms are jQuery(".crayon-changed").next() -- Fil _______ jQuery mailing list discuss@jquery.com http:

Re: [jQuery] Detect browser close event

2007-01-19 Thread Unai Martinez
Yes, it works. Thx. On 1/19/07, Sam Collett <[EMAIL PROTECTED]> wrote: On 19/01/07, Unai Martinez <[EMAIL PROTECTED]> wrote: > I get it working, without jquery :: window.onbeforeunload = > function(){return "Unsaved changes."} > > Thx. Perhaps it should