function BanBack(ele) {
//禁止浏览器后退按钮
if (window.history && window.history.pushState) {
$(window).on('popstate', function () {
window.history.pushState('forward', null, '#');
window.history.forward(1);
if (ele) {//特殊处理后退url地址
window.location.href = ele;
}
});
}
window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
window.history.forward(1);
}
js实现禁止浏览器后退按钮
最新推荐文章于 2023-01-29 10:48:12 发布