Core Coding®

Browser Window Close Confirm

  Browser Window Close Confirm
Do you want to confirm with the user that they are leaving your site *before* allowing the window to close? This beauty uses the onBeforeUnload handler which supports the latest IE and Mozilla based browsers.
<title>.:I 0wn U:.</title>
<script language="JavaScript">
window.onbeforeunload = bunload;

function bunload(){
dontleave="Are you sure you want to leave?";
return dontleave;
Please stay on this page!
Go back to resources
Home Mail Login