Well to answer the OP's question, it will create 100 *listeners* which
each consume a certain amount of memory and each have to be tracked
and deleted if the number of observed items on the page changes after
load. In contrast, a single listener that's listening for a bubbled
event will only consume 1x listener memory, and will be relevant no
matter how many child elements are beneath its scope. I use this
pattern a lot for pages where I am updating the page after load:
adding or removing elements that I need to observe.
But as I mentioned earlier, form element events do not bubble
predictably in my experience.
Walter
On Aug 2, 2010, at 11:44 AM, kenxle wrote:
In my understanding, it will generate one event each time a field is
blurred, not 100 events each time a field is blurred. Each field gets
its own listener.
On Jul 30, 5:51 am, Yozefff <[email protected]> wrote:
Question ..
Let's say I have 100 input fields, type = text. I want to put a
onblur
on all of them and pointing to the same function.
So I've used
$$("input") and invoke a blur.
This works .. but my question is .. will this generate 100 events? So
will my memory get filled with 100 on blurr events?
Would it be the same if I just Even.subscribe 100 times?
greets
--
You received this message because you are subscribed to the Google
Groups "Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
.
To unsubscribe from this group, send email to [email protected]
.
For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en
.
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.