W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] Thoughts on HTML 5

From: Garrett Smith <dhtmlkitchen@gmail.com>
Date: Wed, 17 Dec 2008 19:31:39 -0800
Message-ID: <c9e12660812171931j61e8275el4e70ec9d26a47e9a@mail.gmail.com>
On Tue, Dec 16, 2008 at 5:14 AM, Giovanni Campagna
<scampa.giovanni at gmail.com> wrote:
> Maybe so-called "invalid" HTML attributes are not the only solution, but in
> my opinion it is a simple way to embed metadata within any element.
>
> Imagine that such markup is then passed to a web application through XHR. In
> that case scripts aren't parsed and executed. In this case you have three
> ways to attach a behaviour:
>
> 2) on-event standard attributes (but they not performant since they're
> parsed every time the event fires and the cannot include chars like > or ",
> they need to be escaped)
> 3) assigning a "class" and some metadata using "data-", then
> getElementsByClassName and addEventListener
>

What is the first way?

I usually prefer to use bubbling.

If the callback has an event target that it is interested in, it can
deal with it at that time.

Garrett
Received on Wednesday, 17 December 2008 19:31:39 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC