Log in

goodpods headphones icon

To access all our features

Open the Goodpods app
Close icon
Syntax - Tasty Web Development Treats - Hasty Treat - Things You Should Know About Javascript Events

Hasty Treat - Things You Should Know About Javascript Events

Syntax - Tasty Web Development Treats

05/04/20 • 13 min

plus icon
bookmark
Share icon

In this Hasty Treat, Scott and Wes talk about javascript events, and how to avoid some common pitfalls!

Prismic - Sponsor

Prismic 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 Notes

02: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
Links Tweet us your tasty treats!

05/04/20 • 13 min

profile image
profile image

2 Listeners

plus icon
bookmark
Share icon

Generate a badge

Get a badge for your website that links back to this episode

Select type & size
Open dropdown icon
share badge image

<a href="https://goodpods.com/podcasts/syntax-tasty-web-development-treats-37432/hasty-treat-things-you-should-know-about-javascript-events-1552513"> <img src="https://storage.googleapis.com/goodpods-images-bucket/badges/generic-badge-1.svg" alt="listen to hasty treat - things you should know about javascript events on goodpods" style="width: 225px" /> </a>

Copy