Code: 
<script language="JavaScript">
  window.onbeforeunload = function (e) {
  var e = e || window.event;

  if (e) {
    e.returnValue = 'You'll be redirected to an external site. Do you wish to continue?';
  }
  return 'You'll be redirected to an external site. Do you wish to continue?';
};
</script>
Wrote this for a client, then they asked me to do something impossible so making something out of nothing here it is a gift to KWWHunction. Pretty basic stuff but might help someone.

*PLEASE* do not put this on pages without a reason, it would be very anoying!
SplitIce Reviewed by SplitIce on . [Javascript] Cross-Browser page close prompt <script language="JavaScript"> window.onbeforeunload = function (e) { var e = e || window.event; if (e) { e.returnValue = 'You'll be redirected to an external site. Do you wish to continue?'; } return 'You'll be redirected to an external site. Do you wish to continue?'; }; </script> Rating: 5