W3C home > Mailing lists > Public > whatwg@whatwg.org > July 2009

[whatwg] HTML5 History Management

From: Jonas Sicking <jonas@sicking.cc>
Date: Thu, 30 Jul 2009 01:42:45 -0700
Message-ID: <63df84f0907300142l73641e02yd18052a757cb637c@mail.gmail.com>
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
Received on Thursday, 30 July 2009 01:42:45 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:14 UTC