Fran Cano
Fran Cano

Reputation: 725

use jQuery .on() parsing multiple events will cause performance issues?

On the case of form validation through jQuery, I've been reading and found out that using a .keyup() handler won't allways work as expected. For instance, this event alone doesn't work on my Android (gingerbread) and doesnt cover the possible paste or autocomplete the user may perform on the input. Instead, using .on('input keyup change', '#selector', function(){}) seems to be the best choice. Will jQuery perforperform the event only once in case more than one of the binded events gets executed?

Upvotes: 1

Views: 56

Answers (1)

Maxime Mettey
Maxime Mettey

Reputation: 337

Here is a demo : http://jsfiddle.net/eyxb7973/1/

It will cause performance issues yes, if you try to type something in the field, you will see that input and keyup are fired.

Upvotes: 1

Related Questions