After reading this page http://www.quirksmode.org/js/events_order.html, I can't help but say that Microsoft had really gotten the things right when they decided to do bubbling because capturing is just.. unintuitive
hence this question: in what ways will an event ever need to be set to capturing ? or simply in all the projects you've done, when have you ever required an event to be capturing?
What Kennebec alluded to in the comments is correct. There are events (focus
, blur
) which simply do not bubble, but they will still capture. This allows one to still use event delegation with those events. Event delegation using bubbling/capturing is often times cleaner and more efficient.
Here is a good article from Quirks explaining event capturing and why it makes sense when using events like focus
and blur
:
http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
In my projects, I haven't run into a situation where event capturing was required. However in many places where I've used event bubbling I could have used event capturing instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With