浏览器中使返回上一页失效的js

<script>
    $(document).ready(function(e) {
var counter = 0;
if (window.history && window.history.pushState) {
$(window).on('popstate', function () {
window.history.pushState('forward', null, '#');
window.history.forward(1);
//$("#label").html("第" + (++counter) + "次单击后退按钮。");
});
}
window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
window.history.forward(1);

});

</script>

转载请声明出处

http://blog.csdn.net/bestcxx/article/details/51172921

http://blog.csdn.net/bestcxx      

posted @ 2018-02-08 14:04  阿日斯兰  阅读(377)  评论(0)    收藏  举报