So many ways to bind an event

Posted by XGreen on Stack Overflow See other posts from Stack Overflow or by XGreen
Published on 2010-04-18T16:50:20Z Indexed on 2010/04/18 16:53 UTC
Read the original article Hit count: 296

Filed under:

There are various ways to bind events to elements in jquery

.click , .bind, .live, .delegate, saving events data in .data etc

which is the most superior method among these and why?

wouldn't a single pattern like this be more beneficial?

$('selector').bind({
            event: 'click mouseover ...',
            keepAlive: (true, false, ...),
            trigfunction: (function() {
                // I run for click
            }, function() {
                // i run for mouseover
            }, function() {
                ///...
            })
        });

© Stack Overflow or respective owner

Related posts about jQuery