[whatwg] AJAX History Concerns

Ian Hickson ian at hixie.ch
Mon Nov 23 17:01:42 PST 2009


On Fri, 13 Nov 2009, Justin Lebar wrote:
> On Thu, Nov 12, 2009 at 5:43 PM, Ian Hickson <ian at hixie.ch> wrote:
> > The idea is that the string you would put into the back button or 
> > history menu is not the same as the string you would put into the 
> > title bar or bookmarks (i.e. not the same as <title>).
> 
> That doesn't seem too unreasonable, but I think it's strange to set that 
> title through push/replaceState, since an alternate page title is 
> orthogonal to the idea of an AJAX page with state objects.

No more so than an alternative URL, surely?


> It might be confusing to expose this alternate title in the document 
> object, but perhaps we could expose it as a property or setter function 
> somewhere else.  Then we could persist it properly across forward / 
> backs within the same document.

It seems like that would just cause everyone to call pushState() and 
updateTitle() instead of just calling pushState(), except that then people 
would forget to update the title and your history would have a bunch of 
silly-looking titles like "Inbox (3)", "Inbox (20)", "Inbox (4)".


> > document.title is often used to include things like unread count in a 
> > mail client or RSS reader. That's orthogonal from the state you would 
> > want to show in the back button ("Inbox", "Spam folder", "Settings", 
> > or whatever).
> 
> In this case, it seems like we'd want the bookmark title to use the 
> pushState title, not document.title (e.g. the bookmark would read 
> "Inbox", not "Inbox (8)").

Indeed. Or the title at page load, before dynamic changes.


On Mon, 16 Nov 2009, Mike Wilson wrote:
> 
> It might be good to spell out the fact that 
>   sessionHistoryEntry.title 
> has nothing to do with 
>   document.title
> a bit more explicitly in the text, as this seems to be
> easily misinterpreted (maybe because of the use of the
> "title" identifer?).
> 
> Maybe adding a note to 6.10.1, and/or expanding the note
> about title in 6.10.2 would be good?

Done.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the whatwg mailing list