Detecting Browser History Actions

后端 未结 2 1834
时光说笑
时光说笑 2021-02-07 12:30

I am building a Html 5 website using push state and I wondering whether its possible in javascript or JQuery to detect whether the browser\'s back button has been pushed. I woul

2条回答
  •  有刺的猬
    2021-02-07 12:50

    And for AngularJS

    $window.onpopstate = function(e) {
        $window.alert("location: " + $location.path());
    }
    

提交回复
热议问题