0

I have this code :

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

I have 2 questions about this piece of code :

  1. I have always the message This page is asking you to confirm that you want to leave - data you have entered may not be saved., and I put the message Do you really want to close?

  2. App.confirm show a popup, is possible to display only this popup whitout the confirm default popup from javascript ? Because now I have 2 popups, one default from javascript and another generate by App.confirm()

Thanks in advance.

HareaCostea
  • 145
  • 9
  • 1
    1. This is by design. In most modern browsers you cannot modify the message that's displayed by the alert popped up by this event. 2. No. See #1 – Rory McCrossan Mar 20 '19 at 15:13
  • The ability to set a custom message was removed from most browsers a while back to combat scam sites manipulating tech-illiterate users. – Rence Mar 20 '19 at 15:15

0 Answers0