1在登入页面的html里加入一段js,记住引入jquery文件
$(function() {
if (window.history && window.history.pushState) {
$(window).on('popstate', function () {
window.history.pushState('forward', null, '#');
window.history.forward(1);
});
}
window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
window.history.forward(1);
})
2跳转页面使用window.location.replace()方法跳转,是历史记录一直为登入界面的记录;
3跳转按钮的编写标签千万不能使用a标签,不然会产生跳转前的历史记录,这样浏览器的自带的前进与后退功能不会失效。
4个人推荐两个还不错的博客主(关于代码的牵涉到的内容的详解 (1)https://www.jb51.net/html5/606481.html;