我希望能够实现History.back();
的功能,并且完全刷新上一页。
有没有什么想法可以做到这一点(并且能在IE,FF和Chrome中使用)。
我希望能够实现History.back();
的功能,并且完全刷新上一页。
有没有什么想法可以做到这一点(并且能在IE,FF和Chrome中使用)。
你可以通过window.location将页面重定向到document.referrer
例如:
window.location.href = document.referrer;
修复Internet Explorer无法传递referrer到特定位置的问题:
if(IE){ //IE, bool var, has to be defined
var newlocation = document.createElement('a');
newlocation.href = URLtoCall;
document.body.appendChild(newlocation);
newlocation.click();
}
window.location.replace(document.referrer)