源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

js离开或刷新页面检测(且兼容FF,IE,Chrome)

  • 时间:2021-01-06 15:06 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:js离开或刷新页面检测(且兼容FF,IE,Chrome)
[u]复制代码[/u] 代码如下:
<!DOCTYPE html> <html> <head> <script>   function closeIt()   {     return "Any string value here forces a dialog box to \n" +          "appear before closing the window.";   }   window.onbeforeunload = closeIt; </script> </head> <body>   <a href="http://www.1sucai.cn">Click here to navigate to       www.1sucai.cn</a> </body> </html>
兼容FF,IE,Chrome的js离开或刷新页面检测,关键的部分是要有return
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部