W3C home > Mailing lists > Public > public-webapi@w3.org > November 2005

(wrong string) €“ saving document state by document.save()

From: kenny heaton <kennyheaton@gmail.com>
Date: Tue, 22 Nov 2005 12:13:56 -0800
Message-ID: <65b4e01f0511221213g2be57344l5a75ceec41aad06c@mail.gmail.com>
To: Karl Pongratz <karlhp@karlhp.com>
Cc: public-webapi@w3.org

Karl Pongratz wrote:
>
> Hmm, Jim Ley says something similar what the documentation does:
> "and it requires scripting to sync the local state with what they want
> it to be, and local storage to persist the information,"
>
> Though you say it saves the DOM. Why would I need scripting and probably
> rebuild the DOM if the DOM state is saved?
>
> Do I misunderstand something?

The pushState method takes a DOMobject, which as I understand can be
the entire DOM or just a portion of it. It saves this into the browser
history.

Then when the user clicks the back button, the PopStateEvent is fired.
You have to catch that event and access it's state property. The state
property holds the DOMobject you paced in when you called the
pushState. Then do with the DOMobject what you want. It dosn't ust
magicly remeber the state of the page and restore it for you without
any scripting on your part. Or at least that's how I understand it.

Kenny
Received on Tuesday, 22 November 2005 21:24:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:52 GMT