onbeforeunload

how to change this function into jquery?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
window.onbeforeunload = function (evt) {
  var message = 'Are you sure you want to leave?';
  if (typeof evt == 'undefined') {
    evt = window.event;
  }
  if (evt) {
    evt.returnValue = message;
  }
  return message;
}
</script>
</head>
<body>
we
</body>
</html>

Open in new window

yingwhoAsked:
Who is Participating?
 
kadabaCommented:
http://groups.google.com/group/jquery-en/browse_thread/thread/4e5b25fa1ff5e5ee

I do not see any event supported by them
http://docs.jquery.com/Events

So do not think its feasible. what you have is proper.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.