历史 back() 方法不适用于 Internet Explorer
History back() Method is not working with Internet Explorer
我在公司内部网页上插入了一个历史后退按钮,我刚刚注意到,它可以与 Google Chrome 一起使用,但不能与 Internet Explorer 一起使用。
<button onclick="goBack()">Zurück</button>
<script>
function goBack() {
window.history.back();
}
</script>
是否有任何替代代码,它也保证了 Internet Explorer 的 history.back 功能?我公司有用户使用各种版本的 Internet Explorer,从版本 9 到更新版本。
据我所知,它应该适用于 Internet Explorer 9 以上的版本。
请检查浏览器中同一选项卡的历史记录中是否有上一个网站。
您可以尝试使用:
window.history.go(-1);
我在公司内部网页上插入了一个历史后退按钮,我刚刚注意到,它可以与 Google Chrome 一起使用,但不能与 Internet Explorer 一起使用。
<button onclick="goBack()">Zurück</button>
<script>
function goBack() {
window.history.back();
}
</script>
是否有任何替代代码,它也保证了 Internet Explorer 的 history.back 功能?我公司有用户使用各种版本的 Internet Explorer,从版本 9 到更新版本。
据我所知,它应该适用于 Internet Explorer 9 以上的版本。
请检查浏览器中同一选项卡的历史记录中是否有上一个网站。
您可以尝试使用:
window.history.go(-1);