Railscasts (and I’ve seen this technique elsewhere) seems to be modifying the URL (by adding/changing a query string) but delivers back an ajax request without reloading the entire page. How are they modifying the URL without triggering a whole page refresh? It doesn’t appear at least to be using HTML5 history, since there is no history created (can’t go back/forward).
http://railscasts.com/episodes/81-fixtures-in-rails-2-0
Then click any of the tabs “Show Notes”, “Comments”, “Similar Episodes” and watch how the query string changes, but the page does not refresh (confirmed via Firebug).
Any ideas?
It uses
history.replaceState(). Quoth MDC:No new history entry, nothing to go back/forward to.