Syntax - Tasty Web Development Treats
Hasty Treat - Things You Should Know About Javascript Events
May 4, 2020 · 13 min
0:00-13:40
Streams straight from the publisher. podnod never proxies or re-hosts episode audio.
In this Hasty Treat, Scott and Wes talk about javascript events, and how to avoid some common pitfalls!
Prismic - SponsorPrismic is a Headless CMS that makes it easy to build website pages as a set of components. Break pages into sections of components using React, Vue, or whatever you like. Make corresponding Slices in Prismic. Start building pages dynamically in minutes. Get started at prismic.io/syntax.
Show Notes02:23 - Event bubbling
- Some events bubble, some don’t
- Clicks bubble
- Mouseevents bubble
- Focus doesn’t bubble
04:10 - Event capturing
- Capture: down, bubble up
- Canceling: prevent default
- target` vs currentTarget
- currentTarget is what got clicked
- target is what you listened for the click on
- event.isTrusted
- addEventListener once: true
- Scott’s Instagram
- LevelUpTutorials Instagram
- Wes’ Instagram
- Wes’ Twitter
- Wes’ Facebook
- Scott’s Twitter
- Make sure to include @SyntaxFM in your tweets
prismic.io/syntax
prismic.ioJavascript30
javascript30.comBeginnerJavascript
beginnerjavascript.comScott’s Instagram
instagram.comLevelUpTutorials Instagram
instagram.comWes’ Instagram
instagram.comWes’ Twitter
twitter.comWes’ Facebook
facebook.comScott’s Twitter
twitter.com@SyntaxFM
twitter.com