I think that instead of -
$$("table#people tr td.employee).each(function(item){
Event.observe(item,''click'' function(event){
//Your code HERE
});
});
You should -
Event.observe(document.body,''click'',function(event){
var target = event.target || event.srcElement;
Element.extend(target);
if(target.hasClassName("employee") === false &&
target.descendantOf("peoeple") === false) return;
//Your code
});
On Sep 30, 12:26 am, kspar <da...-ZVSZ1PWk4lFeoWH0uzbU5w@public.gmane.org>
wrote:> Is there a real difference (perf, memory) between observing events
> based on the scoping of event handler assignments? For example, if
> you''re scope is "document" versus "table#people
td.employees" when
> dealing with a page of 500 rows, is there an advantage to one over the
> other? In either case, you dereference the event to get the dom
> object you''re interested in.
>
> I''m trying some experiments, including seeing if there are
different
> answers depending on the browser type (especially IE6 vs IE7) and will
> post my results if anybody is interested.
>
> Thanks,
> David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---