window.onbeforeunload = function(){
    if(document.all){ //ie
        //右上角关闭按钮 或 alt+F4 或 ctrl+w
        if(event.clientX > document.body.clientWidth || event.clientY < 0 ||event.altKey || event.ctrlKey){
            return "关闭窗口";
        }else{
            return "刷新或跳转";
        }
    }else{
        return "刷新、跳转、关闭";
    }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
猜你喜欢
  • 2022-01-15
  • 2021-12-05
  • 2021-07-10
  • 2021-12-26
  • 2021-12-25
相关资源
相似解决方案