i\'m trying to do something similar to some websites where you leave and it\'ll display a popup saying \"Are you sure you want to leave this page\" and with two options sayi
To pop a message when the user is leaving the page to confirm leaving, you just do:
To call a function: