jeudi 24 janvier 2019

How do you prompt a user before they leave a webpage with a custom message?

I am trying to use window.confirm because you can set a custom message whereas with window.onbeforeunload, you cannot.

Something like window.onbeforeunload = () => window.confirm('Are you sure you want to leave') would be nice, but it doesn't work.




Aucun commentaire:

Enregistrer un commentaire