Javascript

Javascript

340 bookmarks
Newest
Why is JavaScript event delegation better than attaching events to each ele
Why is JavaScript event delegation better than attaching events to each ele
I typically recommend using event delegation for event listeners instead of attaching them to individual elements. Let’s say wanted to listen to clicks on every element with the .sandwich class. You might do this. var sandwiches = document.querySelectorAll('.sandwich'); sandwiches.forEach(function (sandwich) { sandwich.addEventListener('click', function (event) { console.log(sandwich); }, false); }); But with event delegation, you would listen for all clicks on the document and ignore ones on elements without the .
·gomakethings.com·
Why is JavaScript event delegation better than attaching events to each ele
What's the difference between JavaScript event delegation, bubbling, and ca
What's the difference between JavaScript event delegation, bubbling, and ca
Yesterday, I wrote about why event delegation is better than attaching events to specific elements. In response, my buddy Andrew Borstein asked: What’s the difference between event delegation/bubbling/capturing? This is a great question that I get fairly often. The terms are often used interchangeably (sometimes by me, oops!), which can cause some confusion. So let’s clear that up today. tl;dr: event delegation is the technique, bubbling is what the event itself does, and capturing is a way of using event delgation on events that don’t bubble.
·gomakethings.com·
What's the difference between JavaScript event delegation, bubbling, and ca
JavaScript async patterns quick guide
JavaScript async patterns quick guide
Patterns and libraries emerged in the JavaScript ecosystem to handle asynchronous programming. Here's a quick guide to our top picks of async patterns.
·imaginarycloud.com·
JavaScript async patterns quick guide
The Writable Files API: Simplifying local file access  |  Web  |  Google De
The Writable Files API: Simplifying local file access  |  Web  |  Google De
The File System Access API enables developers to build powerful web apps that interact with files on the user's local device, like IDEs, photo and video editors, text editors, and more. After a user grants a web app access, this API allows them to read or save changes directly to files and folders on the user's device.
·developers.google.com·
The Writable Files API: Simplifying local file access  |  Web  |  Google De
Nightmare
Nightmare
Nightmare is a high-level browser automation library.
·nightmarejs.org·
Nightmare
JavaScript Promises 101
JavaScript Promises 101
A JavaScript Promise represents the result of an operation that hasn't been completed yet, but will at some undetermined point in the future. An example of such an operation is a network request. When we fetch data from some source, for example an API, there is no way for us
·bitsofco.de·
JavaScript Promises 101