dongwo5449 2016-03-07 09:38
浏览 36

onbeforeunload不适用于Firefox

I needed to pop up a message on the event of closing the browser.I got many solutions in this site.Though the following code is suggested and verified , it works with Chrome and Opera but does not work with Firefox. Is there anything i am missing in execution ? Need Help. Thanks in Advance

<html>
<body>
<script type="text/javascript">
window.onbeforeunload = function (e) {
var message = "Message to Show",
e = e || window.event;

if (e) {
e.returnValue = message;
}

return message;
};
</script>
</body>
</html>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 luckysheet
    • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
    • ¥15 找一位技术过硬的游戏pj程序员
    • ¥15 matlab生成电测深三层曲线模型代码
    • ¥50 随机森林与房贷信用风险模型
    • ¥50 buildozer打包kivy app失败
    • ¥30 在vs2022里运行python代码
    • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误