How to Detect Browser Back Button event - Cross Browser

后端 未结 16 2737
鱼传尺愫
鱼传尺愫 2020-11-21 23:09

How do you definitively detect whether or not the user has pressed the back button in the browser?

How do you enforce the use of an in-page back button inside a sin

16条回答
  •  独厮守ぢ
    2020-11-21 23:53

    This will definitely work (For detecting back button click)

    $(window).on('popstate', function(event) {
     alert("pop");
    });
    

提交回复
热议问题