时间:2021-04-25 10:12:29 | 栏目:JavaScript代码 | 点击:次
实例如下所示:
<script>
$(function(){
if(window.location.href.indexOf("/login") > -1) {
//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
history.pushState(null, null, document.URL);
});
}
});
</script>