记录一下,方便日后使用,如果有人发现有什么不对的地方,请多多指教
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);
window.history.forward(1); // 原理就是产生一个“前进”的动作,以抵消后退功能