How can I prevent [removed] from being triggered by [removed] href links in IE?

前端 未结 6 1711
清酒与你
清酒与你 2021-01-30 05:24

I\'m building a fail safe for my form that is going to warn users that if they leave the page their form data will be lost (similar to what gmail does).

window.         


        
6条回答
  •  Happy的楠姐
    2021-01-30 05:58

    I just ran into a similar problem and found a very easy solution:

    $("a").mousedown(function() {
        $(window).unbind();
    });
    

    This will remove the onbeforeunload event just before the click event is triggered.

提交回复
热议问题