0

enter image description here

I have 2 div's, with red color shown on the picture.

When loaded Div1 is shown and Div2 is hidden.

Div1 has 4 divs in it with 4 onclick events which call ajax and hide div1 and show the second one with the loaded data.

When clicking the browser back button it takes me one page back and i want the page to get back to the default position with the div1 visible and div2 hidden.

How can i do it?

Aleks
  • 3,906
  • 3
  • 24
  • 29

1 Answers1

3

Use the history push state in html5 - https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history

There is also a js script somewhere to default to hashbangs in browsers that don't support the push state.

kalpaitch
  • 5,193
  • 10
  • 43
  • 67