How to "bookmark" page or content fetched using AJAX?

It looks like it can be easy if we just add the details to the "anchor", and then, use the routing or even in PHP code or Ruby on Rails's route.rb, to catch that part, and then show the content or page accordingly? (show the whole page or partial content)

Then it can be very simple? It looks like that's how facebook does it. What are other good ways to do it?