Friday, 16 August 2013

is there a best practice for what to bind custom actions to?

is there a best practice for what to bind custom actions to?

I plan to trigger many custom javascript events, and listen for them like
$(document).trigger('changeSettings',['param1value']);
$(document).on('changeSettings',function(e,param1){
// do something
});
Should I bind these on() events to something other than $(document)? Is it
a bad practice to bind lots of listeners to $(document) or $('body')?

No comments:

Post a Comment