Pretty simple actually... the event would be called
''onBeforeUnload''
8)
so using prototype it would be something like this:
Event.observe(window, ''beforeunload'', function(ev) {
ev.stop();
});
On 9 jan, 12:03, LexNonScripta
<lex.non.scri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Does anyone know how google groups does this:
>
> when you are writing a reply, and try to navigate away from it (press
> the back button, or click a link) it pops up a confirm saying: are you
> sure you want to go and discard your stupid response?
>
> It''s like slapping an observer on window.location, or something...
>
> P.S.:
> This would be soooo cool:
>
> window.location.observe(''change'', function(ev){
alert(''You ain''t going
> nowhere!''); ev.stop() });
>
> or something.. hehe
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---