My client wants the browser's back button to work, but since you're
not moving to a different page or anything, I don't think that's
actually possible, is it?
No, it certainly is possible.
When you navigate within your app, you need to change window.location.hash
or use window.history.pushState
. This will create points in the browser history that can be moved back to without refreshing the page.
Then you need to listen to the onhashchange
or onpopstate
events to detect when the user has pushed the back/forward button. You've got take the information stored in the history or state and update your application to show what you were showing at that point in time.
But honestly, if you've not written your app to be able to do this from beginning, its probably going to be a real pain retrofitting your app now. This works naturally with certain app designs, but other app designs will be near impossible to make work.
Properly supporting the back button is pretty expected from client-side applications today. If you don't support it, or tell your client you can't, its not going to reflect very well on you. Whether or not you make it work for this client, learn how to do it for future projects.
/foo#visible-page