其他瀏覽器的禁用回退按鈕
$(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, '');
window.history.forward(1);
})
關於ie8,ie8是沒有這個功能的,只能通過url來實現
// 直接使用url去替換回退
var hash_current = "#";
var hash_last = "#";
window.location.hash = hash_current;
window.location.hash = hash_last;
window.onhashchange = function () {
window.location.hash = hash_current;
};