Is it possible to do live events in YUI, similar to jQuery's live events?

Posted by eculver on Stack Overflow See other posts from Stack Overflow or by eculver
Published on 2010-06-02T18:52:22Z Indexed on 2010/06/02 18:53 UTC
Read the original article Hit count: 230

Filed under:
|
|

It doesn't currently seem as though there is a way to do live events in YUI similar to jQuery: http://api.jquery.com/live/

It sure would be nice if something like:

function handleClick(e) {
    // click!
}

YUI().use('node-base', function(Y) {
    Y.on("click", handleClick, ".foo");
});

caused handleClick to be fired when a node with the "foo" class was clicked on after being dynamically added to the DOM and sometime after the Y.on was evaluated. I feel like live events are one of jQuery's killer features that YUI lacks.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about yui