How do I implement a back button that goes strictly back through a defined series of layers and always back to the "home" page. I'm hoping to use jQuery for this.
i.e. The user is on the home page and they click to navigate to messages. In this first layer, back button would go to the home page. If they go one layer further and they click a message, the back button would bring you to the messages page, then another click back to home. That set of layers is killed until they go somewhere else.
I am really not sure exactly how to approach this, other than that I'll likely have a certain number of set "stacks". i.e. the messages example would be a stack that the user would go through. And the same would be created for each?
Any and all help is appreciated. Thanks!
You need to look into the History API and possibly select one of the many polyfills out there that allow you to manipulate the browser history by pushing and popping its state. This is the only way to accomplish what you want seamlessly. Only newer browsers support it.