Reputation: 71
I don't know how this is possible but I've seen it in big sites like Facebook and Twitter. I'm using jQuery in prototype to load pages (Ajax-wise). So I want to know how to implement a 'back' button such that when a user clicks back on his/her browser he/she is taken back to the previous page. I believe since it's Ajax, the page is not actually changing so in what way this can be done? Thanks in adv
Upvotes: 2
Views: 5297
Reputation: 7803
They are using pushState
and History APIs.
If you want to do that, you have to have your own code to manage the state of the page. Push it in the history stack and listening to the proper events, restore the state of the page based on the popped state when the back button pressed.
More info about pushState and history API.
Also, take a look at this question and code snippets posted.
Upvotes: 2