Last updated on February 9th, 2022 at 10:45 am
This script will call a function and then prompt user that they are leaving the web page. Here is the sample code.
- In Mozilla “This page is asking you to confirm that you want to leave — information you’ve entered may not be saved.”
- In Chrome “Leave site?“
- In Safari “Are you sure you want to leave this page?“