How to disable beforeunload action when user is submitting a form?

前端 未结 7 2344
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 12:48

I have this little piece of code:



        
7条回答
  •  自闭症患者
    2020-11-28 13:04

    if you're using bind then use this:

    $('form').submit(function () {
        $(window).unbind('beforeunload');
    });
    

    This will be good for all form submit.

提交回复
热议问题