ga-wdi-boston / jquery-dom

Other
0 stars 139 forks source link

Add a best practices list #13

Closed jrhorn424 closed 8 years ago

jrhorn424 commented 8 years ago

Some things to include:

payne-chris-r commented 8 years ago

@jrhorn424 I'm happy to add this, and think I mentioned it last time, but I'd love to put a solid reason behind why .on('click',...) > .click() in the README if possible.

jrhorn424 commented 8 years ago

Pedagogically, it gets them thinking about events. It's less magic. More importantly, we can't take advantage of bubbling to event delegation with click. Compare the signatures:

  1. https://api.jquery.com/click/
  2. http://api.jquery.com/on/