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

[whatwg] <a onlyreplace>

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 16 Oct 2009 17:09:26 -0500
Message-ID: <dd0fbad0910161509o4d00ddb2o82afd2b006a1eb4b@mail.gmail.com>
On Fri, Oct 16, 2009 at 5:08 PM, Markus Ernst <derernst at gmx.ch> wrote:
>> (Also, in your examples you probably want @onlyreplace="content
>> navigation", since your nav is changing from page to page as well.
>
> Indeed. Or, maybe I'd do it slightly differently, somehow like:
>
> <ul id="navigation">
> ?<li><a href="page1.html" onlyreplace="content" class="thisPage"
> ? ?onClick="resetNavigation(this)">Broccoli</a></li>
> ?<li><a href="page2.html" onlyreplace="content"
> ? ?onClick="resetNavigation(this)">Leak</a></li>
> </ul>
>
> The resetNavigation() function then takes the class attribute from the old
> link and adds it to the clicked one. So the navigation can be static, and
> though its appearance remains consistent, whether page2.html is completely
> loaded, or only the parts defined in @onlyreplace.

Yup, that'd work too.

~TJ
Received on Friday, 16 October 2009 15:09:26 UTC

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