In my previous post, Don’t Break The Back Button, I explained the difference between URL changing “horizontal” links and Ajax’s non-URL changing “vertical” links. If you haven’t already read that post, I encourage you to do so before reading this one.
In addition to potentially breaking the back button, Ajax’s vertical links can ruin a browser’s ability to link to the current resource. This is very similar to the way in which HTTP POST requests can’t be bookmarked in the same way as HTTP GET requests since they don’t include any query data in the URL.
Not only will this problem frustrate users who are interested in coming back to your web site; it will also make it difficult or impossible for search engines to properly link to your second-tier resources.
The same libraries discussed in the previous post that solve the back button problem can also be used to solve Ajax’s bookmarking problem. I’ll re-list those resources here for convenience:
Although not a perfect solution, providing the user with a link to the current page (with its current state information in the query string) can partially make up for the lack of bookmarking support. This is the approach that Google Maps uses. When a user queries an address at Google Maps, the URL initially remains the same. (http://maps.google.com) However, when clicking “Link to this page”, the URL is reformatted to include the street address in the query string. (http://maps.google.com/maps?f=q&hl=en&q=pittsburgh,+pa&btnG=Search)
This technique is essentially creating a horizontal representation of the otherwise vertical link that led to the page with its current state. Implementing this solution requires a few considerations: