[whatwg] pushState

Ian Hickson wrote:
> On Fri, 25 Jul 2008, Jonas Sicking wrote:
>> So what I think we should do is to enforce that 'data' is a JSON
>> serializable object.
> 
> (We need a better term -- and definition -- for this.)

I'll check with the ECMA Script folks, but this one might be an
alternative to link to:

http://wiki.ecmascript.org/doku.php?id=es3.1:json_support

State that the object passed as 'data' is passed to JSON.parse with the
second argument not specified. Any exception thrown is forwarded out to
the caller of pushState as usual.

>> When entering a SH state for which a Document has been destroyed, we 
>> load the URL associated with that SH entry. After the 'load' event for 
>> the Document has fired, and if a data object was provided in the 
>> pushState call for the SH entry, we fire a PopStateEvent event 
>> containing the data stored for the object.
> 
> How would this work with bookmarking?

Just as specified (or at least intended) in the spec right now.

Say that the user starts on page1.html

<bookmark>   (bookmarks page1.html)
pushState("title", "data")
<bookmark>   (bookmarks page1.html)
pushState("title", "data", "page2.html")
<bookmark>   (bookmarks page2.html)

Additionally, a UA is free to add the ability to store the data 
parameter in its bookmark storage. For example firefox under some 
circumstances flags URIs in the bookmark store as POST URIs, i.e. they 
should be fetched with POST rather than GET (this is specifically for 
search engine bookmarks). Similarly the data can be stored alongside the 
URI for the bookmark, however this is optional, just like the fastback 
cache.

/ Jonas

Received on Tuesday, 29 July 2008 10:48:20 UTC