angularjs 阻止浏览器自带的回退

 

 

    $scope.$on('$locationChangeStart', function(e) { if(!tfOrder && comm.getStorage('orederlistLen')>0){
            if(confirm("退出将清空投注")){   //浏览器自带返回按钮点击时,清空投注 
          //code
}else{ e.preventDefault(); //阻止后退 } } });

 

 

http://www.cnblogs.com/gaoruixin/p/6070502.html

posted @ 2017-10-11 20:49  快乐的咸鱼  阅读(1918)  评论(0编辑  收藏  举报