Reputation: 3966
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?
Upvotes: 0
Views: 5943
Reputation: 5271
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.
Upvotes: 3