I've been looking around for a while and haven't quite found what I've been looking for. My web page stores reports, and the user has the ability to save these reports.
I'm looking for a method, using jquery or the javascript onunload/onbeforeunload to ask the user if they wish to save the report or continue without saving when the browser is closed/navigated from.
Using onbeforeunload I can give the user the ability to stop navigation and manually save, although I would rather the save be done through the dialog box. Another problem with onbeforeunload is that clicking tags calls the onbeforeunload method too.
The save is asynchronous and takes a few milliseconds.
Any suggestions are welcome.
Regards, Byron Cobb.