浏览器中使返回上一页失效的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

浙公网安备 33010602011771号