I'm using Infinite Scroll on my site. I have a comments feed on each post that uses infinite feed. When someone clicks on one of the comments, the comment's replies should load. When someone clicks on one of the comment's replies, then that reply will show. By default, replies to comments don't have replies. Every view, will have the post shown along with the parent comment. So I'll have 3 views:
Fist view
Post
|
Comments
Second View
Post
|
Comment
|
Replies
Third View
Post
|
comment
|
reply
This is very simple to create normally, however, I'd like to create all this using the History API. So for example, if the user lands on the first view, then they click on a comment the second view should be loaded in using PushState and the new replies feed should be loaded in using Ajax. Here's where I'm getting confused. How can the feed retain its place if the user clicks the back button. So for example, if they're on replies and they hit back then they'll be shown the same place they were in the comments feed. Is there a simpler way of doing this.
P.S this is very similar to Twitter's comment system.