【问题标题】:Custom JQuery dialog on before unloading page卸载页面前的自定义 JQuery 对话框
【发布时间】:2014-03-19 08:11:32
【问题描述】:

想要在用户尝试离开当前页面/表单或尝试关闭窗口时显示带有 Yes 、 No 和 Cancel 按钮的自定义 jquery 对话框。

在 beforeload 事件上显示默认浏览器对话框确认。我不想显示那个对话。

是否可以阻止默认卸载事件并显示自定义对话框?

【问题讨论】:

标签: javascript jquery onbeforeunload window.onunload


【解决方案1】:

请改用下面的 jquery 函数。

$(window).on('unload', function(){
  //Display Dialog here.
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-04-29
    • 1970-01-01
    • 1970-01-01
    • 2018-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多