So many ways to bind an event
- by XGreen
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() {
///...
})
});