js实现用户关闭页面时提示是否离开此页面的方法

版权声明:未经允许,不得转载 https://blog.csdn.net/dhj199181/article/details/84287220
<script type="text/javascript">
  window.onbeforeunload = function(){
      return "您确定要退出页面吗?";
  }
</script>


效果图

猜你喜欢

转载自blog.csdn.net/dhj199181/article/details/84287220