Beforeunload事件未获取自定义消息

时间:2019-03-20 15:12:12

标签: javascript jquery jquery-ui

我有此代码:

$(window).bind("beforeunload", function() {
  App.confirm('popup.cancel.confirmation.message', $('#confirm-import-modal'), true);
  return "Do you really want to close?";
});

我对这段代码有2个问题:

  1. 我总是收到消息This page is asking you to confirm that you want to leave - data you have entered may not be saved.,然后输入消息Do you really want to close?

  2. App.confirm显示一个弹出窗口,是否可以仅显示此弹出窗口,而不显示来自javascript的确认默认弹出窗口?因为现在我有2个弹出窗口,其中一个默认值来自javascript,而另一个默认值则由App.confirm()

  3. 生成

谢谢。

0 个答案:

没有答案