[whatwg] <a onlyreplace>

Tab Atkins Jr. jackalmage at gmail.com
Sun Oct 18 10:23:32 PDT 2009


On Sun, Oct 18, 2009 at 12:20 PM, Nelson Menezes
<flying.mushroom at gmail.com> wrote:
> 2009/10/18 Tab Atkins Jr. <jackalmage at gmail.com>:
>> As long as the event bubbles, you can always just listen at the
>> document root and then check event.target to see who got updated.
>> That way you don't have to wait, nor do you have to know which
>> specific bits are getting replaced.
>
> You would want the event to fire once, though, regardless of how many
> targets are being replaced. Otherwise you won't be able to distinguish
> 3 events generated by one response with content for #div1,#div2, and
> #div3. Event.target should be the original <a> or <form> element, or
> the window object if the request originated via scripting.

My thoughts were that the event fires at the replaced elements, not
the <a> or <form> that triggered the navigation.  So you *would* be
able to distinguish multiple elements, as their event.target would
point to each element as appropriate.

This isn't a click or whatever event, it's a load/unload event.  The
<a> or <form> isn't doing either.

~TJ


More information about the whatwg mailing list