[whatwg] <a onlyreplace>

Markus Ernst derernst at gmx.ch
Mon Oct 19 10:02:40 PDT 2009


Tab Atkins Jr. schrieb:
> On Mon, Oct 19, 2009 at 3:49 AM, Markus Ernst <derernst at gmx.ch> wrote:
>> What do you think about:
>>
>> 1. Defining which ids are to be replaced:
>> - The list of IDs to replace is in <base> tag, as described earlier in this
>> thread. <a> and <form> elements can have a boolean @onlyreplace attribute
>> that specifically enables or disables the functionality for the element.
>> - If at least one of the IDs is found in the linked document, replace the
>> IDs that are found. Ignore IDs that are not present in the linked document,
>> or in the document that contains the link (important for dynamic
>> applications, so the <head> section is not forced to know the state of the
>> <body>).
>> - If none of the indicated IDs are found, *replace the whole page*. This
>> makes it possible to prevent e.g. a wiki or forum from being @onlyreplaced
>> by just using different IDs.
> 
> I'm definitely for the last one.  As well, if you recieve any response
> that indicates the resource you've gotten isn't what you asked for
> (like a 404 status code), also replace the whole page. 

I am sorry I expressed myself in a misunderstandable way... I did not 
mean this as alternatives, but as a description of "how it works" from 
the author/user point of view - what happens if not all IDs mentioned in 
the onlyreplace list are found either in the page that contains the 
link, or in the page linked to:
- if one or more IDs are found, replace those elements only
- if none are found, replace the whole page



More information about the whatwg mailing list