OnBeforeUnload in IE 11 and above

Woon Choon Thin 21 Reputation points
2022-01-14T02:35:14.91+00:00

Hi All,

i realized that no custom error message can be show in IE11 when i use onbeforeunload javascript method.
Is that any way to archive this part?

Secondly, is that any way to trigger ajax when user press leave when the pop-up from onbeforeunload javascript method?

Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-01-17T07:03:57.373+00:00

    Hi @Woon Choon Thin

    What do you mean custom error message? You can only show custom message together with the default message when using onbeforeunload in only IE 11. You can refer to this sample code.

    For the second question, you can't find out which button the user clicked in onbeforeunload so you can't trigger ajax when user presses leave.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Regards,
    Yu Zhou

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Woon Choon Thin 21 Reputation points
    2022-01-17T07:24:59.393+00:00

    Hi YuZhou,

    How to show custom message in Microsoft Edge ?
    According to sample given , there are no custom message show.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.