Brian Dinsmore
2007-Jan-11 20:18 UTC
slightly off-topic: does anyone know how google captures a user click on the X to close the browser window in gmail?
upong clicking on the X to either close the tab or window in every browser, gmail gives me a confirm close message asking me whether or not I would like to navigate away from the current page that I am on, or cancel, and remain on the current page. does anyone know how they do this? thanks! brian dinsmore --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Mark Renn Caluag
2007-Jan-12 01:04 UTC
Re: slightly off-topic: does anyone know how google captures a user click on the X to close the browser window in gmail?
i believe they''re using onunload On 1/12/07, Brian Dinsmore <bdinsmor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > upong clicking on the X to either close the tab or window in every > browser, gmail gives me a confirm close message asking me whether or not I > would like to navigate away from the current page that I am on, or cancel, > and remain on the current page. does anyone know how they do this? > > > thanks! > > brian dinsmore > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Dinsmore
2007-Jan-12 03:20 UTC
Re: slightly off-topic: does anyone know how google captures a user click on the X to close the browser window in gmail?
after a little more digging, it looks like they are trapping the onbeforeunload event and returning a string "are you sure?" var, which then it looks like gets inserted to the browser template that seems to be "you are about to navigate away from this page." <new line> <message returned by trapping onbeforeunload event> "Click Ok to continue, or cancel to stay on current page." thanks for the response... On 1/11/07, Mark Renn Caluag <markrenn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > i believe they''re using onunload > > On 1/12/07, Brian Dinsmore <bdinsmor-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > upong clicking on the X to either close the tab or window in every > > browser, gmail gives me a confirm close message asking me whether or not I > > would like to navigate away from the current page that I am on, or cancel, > > and remain on the current page. does anyone know how they do this? > > > > > > thanks! > > > > brian dinsmore > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---