Nilesh
Nilesh

Reputation: 1

window.history.go(-1) is not working in ie 6

window.history.go(-1) is not working in IE6

Any Other solution for back button which can work in IE6.

Upvotes: 0

Views: 1948

Answers (2)

genesis
genesis

Reputation: 50976

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

Upvotes: 1

nickf
nickf

Reputation: 546085

You can use window.history.back()

Upvotes: 0

Related Questions