I need a stateless way to implement the back button feature in an ajax forum such that if a user is on page 2 of the topics ajax page, and then clicks on the message – when the user then hits the back button they can go back to the point of the message on the topics ajax page. – your help would be much appreciated.
::Please remember I want a stateless way of doing this, such that it’s done client side::
The only option you have is to implement a client-side routing mechanism which you can either achieve by changing the
#in your url whenever you change state. For instance your topics page has a url likeyourforum.html#topicsand whenever a user clicks on a message, you redirect (client-side) toyourforum.html#message/3.Your JavaScript code should listen to those hash changes and react accordingly by loading topics/messages.
There 2 ways of client-side routing:
Many modern JavaScript frameworks like Backbone, JavaScriptMVC etc… support routing. So you might take a look at those. TodoMVC might be a good starting point. Otherwise try to google for some jQuery plugins which give you this kind of functionality.