I’ve read the jQuery documentation on event handling, but I still can’t really understand what I should do.
I have a mobile app where content is loaded with ajax, so events can’t be bound at document onLoad for that content.
As my application grow I now start to be concerned that wrong event handling can give performance problem.
What is the implications on performance choosing between on(), live() and delegate() ?
Something else to take into consideration?
From jQuery 1.7, the official (and most performant) way to bind events is
.onand.off. It’s fastest when combined with anidbased selector:.onsupercedes.live.delegateand.bind, see here for more info:http://blog.jquery.com/2011/11/03/jquery-1-7-released/