<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h2>浏览器的各种事件</h2>
<input type="text" name=""  />
<script type="text/javascript">
//刷新页面生效 页面内容改变以后离开当前页面 或者关闭当前页面生效
window.onbeforeunload=function(e){ 
  var e = window.event||e; 
  e.returnValue=("确定离开当前页面吗?");
} 
</script>
</body>
</html>

  

相关文章:

  • 2021-11-03
  • 2021-08-11
  • 2021-12-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2021-12-29
  • 2021-11-23
相关资源
相似解决方案