window.onbeforeunload = check; function check() { var response = confirm("Are you sure you want to exit this page?"; if(response == true) { // Do what ever you want to do. Call function to save data. } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)