W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2007

[whatwg] Offline Web Apps

From: Dimitri Glazkov <dimitri.glazkov@gmail.com>
Date: Thu, 13 Sep 2007 12:41:11 -0500
Message-ID: <fb15ac210709131041q46f64c45o72654552df94f5e3@mail.gmail.com>
On 9/13/07, Anne van Kesteren <annevk at opera.com> wrote:
> You seem to have missed what I pointed out earlier:
> http://www.whatwg.org/specs/web-apps/current-work/#pushstate This allows
> applications to make distinct URIs while keeping all the other benefits.

Yes, it does, and I apologize I missed that.

Upon studying the pushState spec a little bit closer, I can't help but
think that it's not quite what the doctor ordered. Consider this
scenario:

I start with the following markup (could've borrowed code from
Bugzilla, but eh, too lazy):

<ul>
   <li><a href="add-bug">Add New Bug</a></li>
   <li><a href="browse/">Browse Existing Bugs</a></li>
</ul>

Now, in order to preserve context when the user clicks on these links,
I have to:

1. Attach event handler to each link, which:
2. Disables event propagation and cancels the event
3. Creates (or retrieves from history) the state object
4. Pushes state object with the URL, provided in "href' attribute
5. Still does XHR request to the target page to retrieve needed information
6. Modifies DOM of current page to replace parts or whole of the page
with the data, retrieved with the XHR.

Correct me if I am wrong, but a lot of this pseudo-code is essentially
replicating browser's  hyperlink behavior all over again.

I am not sure I have a better alternative, but it just seems that
there has to be a better way. Especially considering that the way this
develops is in our hands at the moment.

:DG<
Received on Thursday, 13 September 2007 10:41:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:57 UTC