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

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

I have this little piece of code:



        
7条回答
  •  猫巷女王i
    2020-11-28 12:56

    Looking for Detect onbeforeunload for ASP.NET web application well I was, I've to show warning message if some input control changes on the page using ASP.NET with Master Page and Content Pages. I'm using 3 content placeholders on the master page and the last one is after the form

    so after the form closing tag and before the body closing tag used this script

    
    

    beforeunload doesn't work reliably this way, as far as binding goes. You should assign it natively

    so I got it working like this bind and unbind didn't work out for me also With jQuery 1.7 onward the event API has been updated, .bind()/.unbind() are still available for backwards compatibility, but the preferred method is using the on()/off() functions.

提交回复
热议问题