if (window.history && window.history.pushState) {
var data = {rand: Math.random()};
window.history.pushState(data, '', '');
$(window).on('popstate', function() {
window.location.href = window.location.href;
history.go(-1);
//location.reload();
});
}
我使用上面的代码重新加载浏览器后面的按钮页面按钮,但它不工作在mozilla中...也禁用从铬的前进按钮...有什么办法重新加载前一页没有硬编码的网址? ?? 感谢您的帮助什么是history.go(-1);在mozilla
尝试'window.history.go(-1)' –
也删除此行:'window.location.href = window.location.href;'因为它可能会重新加载页面。 –
'history.back()'...怎么样? –