[whatwg] Proposed changes to the History API

Justin Lebar justin.lebar at gmail.com
Fri Aug 21 18:07:34 PDT 2009


Mike Wilson wrote:
> It would be interesting to see a concrete
> example on how you intend the dynamics of your solution to
> work. It would be great if you could outline the different
> events and method calls used (in order) to save and restore
> the history state object in the following situations:
> - doing a "fresh" navigation from page#1 to page#2
> - going back in history from page#2 to page#1

Here's one way it could go:

User was at http://google.com, types http://mozilla.com/index.html#1
into address bar.
* onload
* stateactivated
User clicks on link with href "#2"
* statedeactivated (until this event is complete,
document.location.hash == "#1" and the pageStorage object is for the
"#1" state)
* stateactivated (at the beginning of this event,
document.location.hash == "#2" and the pageStorage object is for the
"#2" state)
User clicks back
* statedeactivated (for #2)
* stateactivated (for #1)

I might be introducing horrible races into the HTML5 event model by
doing this, though.

-Justin


More information about the whatwg mailing list