[whatwg] HTML5 History Management

Jonas Sicking jonas at sicking.cc
Thu Jul 30 01:42:45 PDT 2009


On Wed, Jul 29, 2009 at 7:38 PM, Nathan Hammond<nathan at nathanhammond.com> wrote:
> Clarifications
> 1. window.history.pushState({}, "Title",
> "/path/to/new/file.html?s=newvalue#newhash") replaces the current document
> object with the one specified by the new URL. It then causes the event
> popstate to fire immediately after the load event, correct?

No. The above line with change the uri of the existing document to be
"http://example.com/path/to/new/file.html?s=newvalue#newhash" (with
the part before 'path' obviously depending on where the original page
lives).

So no network activity takes place and the Document node remains the
same. Also no popstate event is fired.

> 2. window.history.pushState({}, "Title", "#newhash") creates a new history
> state object with the specified data object, the specified title, the same
> document object, and a location object that replaces the existing hash with
> "#newhash", correct?

Yes.

/ Jonas



More information about the whatwg mailing list