Single Page Application (SPA) is very popular recently. However, the semantics of URL is sometime lost. For example, when we try to bookmark an interesting page in SPA, we indeed can only bookmark the landing page.
MDN says “history.replaceState() operates exactly like
history.pushState() except that
replaceState() modifies the current history entry instead of creating a new one.” as of 11/19/2016.
I just want to point out replaceState() modifies (and, in fact, replaces) the current history entry in my experience.
To learn how to use History API, I recommend these resources as the start:
- https://css-tricks.com/using-the-html5-history-api/ by Robin Rendle, CSS-Tricks