Javascript - Message before the user closes the page (without using onbeforeunload)

Asked

Viewed 19 times

0

I would like to know how to display a message before closing the page, which in my case would be confirmation, as what happens on this site: http://processamentodigital.com.br/

So far I only found how to do through javascript with the "onbeforeunload", however, I would like to display a personalized homage to the user, thing that the mentioned function does not allow.

  • Hi Rafa. It is impossible to determine precisely when the user is closing the window, and there is also no way to customize the confirmation dialog, read the following links: https://answall.com/a/80707/3635, https://answall.com/a/113155/3635. To summarize, no specific event for capturing closures, all attempts to treat this are gambiarras using the event mouseout in the window

  • Hello William! Oh yes, I understand.. Anyway, thank you so much for the return!

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.