📜  离开页面 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:38.342000             🧑  作者: Mango

代码示例1
window.onbeforeunload = function(){
  myfun();
  return 'Are you sure you want to leave?';
};