2011-07-19 19 views
0

window.history.go(-1)的工作未在IE6window.history.go(-1)中未即6

對後退按鈕可以工作在IE6任何其他解決方案的工作。

+1

IE9不supprt的HTML5歷史API。是什麼讓你認爲IE6會? – Raynos

+0

作爲一個純粹的技術問題,這屬於StackOverflow(請不要在那裏重新發布它,如果有足夠的人投票結束它,它將被自動化)。 –

+0

@Raynos'history.go()'方法不是HTML5 History API的一部分。 – duri

回答

1

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]--> 
+0

感謝您的回覆,我已嘗試如上所述。但它甚至不工作 – Nilesh

+0

任何其他解決方案? – Nilesh

+0

history.go(-1); return false; –

0

您可以使用window.history.back()

+0

window.history.back()不適用於ie6 – Nilesh

+0

很明白,對於後退按鈕,有兩種方法1)window.history.back()2)history.go(-1),但兩者都不工作IE6。是任何一個能夠建議,任何其他選項得到這個? – Nilesh

+0

你確定有一個頁面可以返回*到*嗎? – nickf

相關問題