window.history.go(-1) is not working in ie 6
window.history.go(-1) is not working in IE6
Any Other solut开发者_JS百科ion for back button which can work in IE6.
IE6 has trouble with window.history.go(). It works on regular links like this:
<a href='#' onclick='history.go(-1);'>Back!</a>
But some others won't work. You could try this:
<button onclick='history.go(-1);'>Back!</button>
But I'm not quite sure if that would work. You could also show a button for all other browsers and a link for 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]-->
You can use window.history.back()
精彩评论