Javascript window.history.go(-1)不在ie 6中工作

Javascript window.history.go(-1)不在ie 6中工作,javascript,internet-explorer,Javascript,Internet Explorer,window.history.go(-1)在IE6中不起作用 任何其他可以在IE6中工作的后退按钮解决方案。IE6在window.history.go()上有问题。它适用于以下常规链接: <a href='#' onclick='history.go(-1);'>Back!</a> 但其他一些是行不通的。你可以试试这个: <button onclick='history.go(-1);'>Back!</button> 回来! 但我不确定这

window.history.go(-1)在IE6中不起作用


任何其他可以在IE6中工作的后退按钮解决方案。

IE6在window.history.go()上有问题。它适用于以下常规链接:

<a href='#' onclick='history.go(-1);'>Back!</a>

但其他一些是行不通的。你可以试试这个:

<button onclick='history.go(-1);'>Back!</button>
回来!
但我不确定这是否有效。您还可以显示所有其他浏览器的按钮和IE的链接:

<button id='backButton' onclick='history.go(-1);'>Back!</button>
<!--[if IE 6]>
    <script type='text/javascript'>
        document.getElementById('backButton').style.display = 'none';
    </script>
    <a href='#' onclick='history.go(-1);'>Back!</a>
<![endif]-->
回来!

您可以使用
window.history.back()
IE9不支持HTML5历史API。你怎么会认为IE6会呢?这是一个纯粹的技术问题,属于StackOverflow(不过请不要在那里重新发布,如果有足够多的人投票关闭它,它将自动迁移)。@Raynos
history.go()
方法不是HTML5历史API的一部分。可能是@duri的副本谢谢你的回复,我已经按照上面所述进行了尝试。但它甚至不起作用。众所周知,对于后退按钮,有两种方式1)window.history.back()2)history.go(-1),但这两种方式在ie6中都不起作用。有没有人能建议,有没有其他方法可以得到这个?你确定有一个页面可以返回?