📜  离开页面前确认javascript代码示例

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

代码示例1
//says: do you want to leave this site changes may not be saved
window.onbeforeunload = function(e) {
  return "Do you want to exit this page?";
};