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

[whatwg] element.onFocus instead of window.onhashcange ?

From: Bjartur Thorlacius <svartman95@gmail.com>
Date: Sat, 21 Nov 2009 21:33:24 +0000
Message-ID: <e205f470911211333h1f733845x168a0dbe02cb7ef8@mail.gmail.com>
On 11/19/09, Dean Edwards <dean.edwards at gmail.com> wrote:
> On 17/11/2009 15:50, Bjartur Thorlacius wrote:
>> As the discussion had turned into bunch (good) advice giving, I
>> decided to repost this if anyone actually has opinion on this matter
>> and/or could tell me why the spec recommends firing hashchange on the
>> document instead of a specific element when a user navigates to a URI
>> with a hash component.
>>
>
> A lot of Ajax apps will manipulate the value of location.hash to
> represent the *state of the application*. In this case there is no
> corresponding element to trap the onfocus event.
Could you please explain to me (forgive me, I haven't got much
experience on this topic) why "webapps" can't either have a specific
element for <inbox> and <sent mail>, or even different pages? Why is
it so terrible to navigate to another page to fetch another mail
folder? They have to fetch the data from the server anyway. And even
if they wan't to do some fancy AJAXy stuff they can always use the
HIDDEN attr (or CSS) to hide currently irrelevant parts of the app and
fill in new data with JavaScript/ECMAScript as it arrives.

And I think these approaches would be more backwards-compatible than
rewriting the document with XHR on hashchange.

And btw, my Gmail is configured to use 'basic HTML', which AFAIK makes
each view a new page.
Received on Saturday, 21 November 2009 13:33:24 UTC

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