Full version: jsB@nk » Snippet » Confirm Close
URL: https://www.javascriptbank.com/confirm-close.html
Use this JavaScript to confirm the closing of a window. It includes a cancel option. A valuable tool for those important popups.
Full version: jsB@nk » Snippet » Confirm Close
URL: https://www.javascriptbank.com/confirm-close.html
<script type="text/javascript"><!-- Begin/*Created by: Steeveeo :: http://www.freewebs.com/steeveeo3000 */function confirmClose() { alert("You have chosen to close this window"); if (confirm("Are you sure?")) { parent.close(); } else alert("Close cancelled."); { }}// End --></script><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->
<form><input type="button" value="Close" onclick="confirmClose()"></form><!-- This script downloaded from www.JavaScriptBank.com Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->