Hi there,
I'm trying out jquery as a javascript library over prototype. Now when it comes to event delegation in prototype I can do the following:
$('wrapper').observe('click', function(event) {
var foo = Event.findElement(event, '.foo1');
if (foo) // do something
var bar = Event.findElement(event, '.bar1');
if (bar) // do something else
});
So this means only one click handler is placed on the document.
I know jquery has live/delegate methods, but it seems you need to provide the selector in the call (unless I'm mistaken?). Is there a similar way to have just one click handler and do something similar? Or is it better to split them up as separate events?
Thanks