ResizeObserver demo
_sortieren
DOM diffing with vanilla JS
A couple of weeks ago, we looked at how to build reactive, state-based components with vanilla JS.
How to create a state-based UI component How to add reactivity to a state-based UI component with Proxies How to batch UI rendering for better performance Today, we’re going to learn how to add DOM diffing to our component.
If you haven’t yet, go back and read the first three articles, or today’s won’t make a whole lot of sense.
The Web smallest DOM diffing library
This post is a recap of a personal journey, that lasted about 3 years, in search of the best DOM diffing options I could find.
Responsive and Infinitely Scalable JS Animations
TremulaJS: a Javascript UI component designed to navigate large result sets of visual content with a high degree of UX fluidity.
Web Components Are Easier Than You Think | CSS-Tricks
When I’d go to a conference (when we were able to do such things) and see someone do a presentation on web components, I always thought it was pretty nifty
DOM City
Learning the DOM-API in a playful way
Four different ways to inject text and HTML into an element with vanilla JavaScript
Today, we’re going to look at four different techniques you can use to get and set text and HTML in DOM elements.
Let’s dig in!
The Element.innerHTML property You can use the Element.innerHTML property to get and set the HTML content inside an element as a string.
div class="greeting" pHello world!/p /divlet greeting = document.querySelector('.greeting'); // Get HTML content // returns "pHello world!/p" let html = greeting.innerHTML; // Set HTML content // This replaces what was in there already greeting.
Five more ways to inject HTML into the dom with vanilla JavaScript
Yesterday, we looked at four ways to inject text and HTML into the DOM with vanilla JS. Today, we’re going to look at five more.
Let’s dig in!
The document.createElement() method You can use the document.createElement() method to create an element. Pass in the element to create, without angled brackets (), as an argument
let div = document.createElement('div'); let link = document.createElement('a'); let article = document.createElement('article'); You can use any valid HTML tag, and even create custom ones, too.
How to create a search page for a static website with vanilla JS
One of the biggest missing features from most static site generators (like Hugo, 11ty, and Jekyll, ) is that they lack built-in search.
Database-driven platforms like WordPress make a server call and search the database to find matching content. Static websites have no database to query.
Today, I’m going to share how I built the search functionality for my site with vanilla JS. Let’s dig in!
Quick aside: done-for-you alternative If you don’t want to roll-your-own search functionality, Algolia and ElasticSearch are two done-for-you search vendors.
Learn javascript in Y Minutes
The Ultimate Guide to Optimizing JavaScript for Quick Page Loads
Great performance is key for great UX. We’ve told you how to tackle the low-hanging fruit: optimizing images for faster page loads. Now it’s time to fight the boss: JavaScript. Check out our handy guide!
Why is Builder.io creating Qwik and Partytown?
Excess first-party and third-party JavaScript in your code takes over your main thread and makes your websites slow. We’ve got two open-source solutions that can solve this major problem.
Hydration is Pure Overhead
Why hydration is a workaround, not the solution.
CTA Modal: How To Build A Web Component — Smashing Magazine
In this article, Nathan Smith explains how to create modal dialog windows with rich interaction that will only require authoring HTML in order to be used. They are based on Web Components that are currently supported by every major browser.
lonekorean/gist-to-prismjs: Converts embedded GitHub gists into PrismJS code blocks.
Converts embedded GitHub gists into PrismJS code blocks. - lonekorean/gist-to-prismjs: Converts embedded GitHub gists into PrismJS code blocks.
Lottie-Animationen in Websites integrieren
Mit Lottie könnt ihr unkompliziert skalierbare und interaktive Animationen in Websites integrieren. Das sog. Lottie-File basiert auf JSON und wird mittels JavaScript in die Website integriert.
Patterns for Building JavaScript Websites in 2022
Deciding on the approaches and tools to use to build on web these days can be a challenging prospect....
A New Pattern For The Jamstack: Segmented Rendering — Smashing Magazine
In this article, we will push the boundaries of static rendering and learn how to apply it to personalized content. “Segmented Rendering” is a new pattern and it will change the jamstack game forever.
Custom events with vanilla JS
JavaScript provides developers with a way to emit custom events that developers can listen for with the Element.addEventListener() method.
We can use custom events to let developers hook into the code that we write and run more code in response to when things happen. They provide a really flexible way to extend the functionality of a library or code base.
Today, we’re going to learn how they work. Let’s dig in!
Custom event naming conventions
This week, we looked at how to create custom events with vanilla JS, and a helper function to make things a bit easier. Today, we’re going to look at different naming conventions for custom events.
To help prevent naming collisions, it’s a good idea to prefix custom events with your library or project name.
// Namespaced to the Calculator library emit('calculator-add'); One common naming convention is kebab-case.
// kebab-case naming emit('calculator-add'); Another convention is to put a colon (:) between the library name and the event type.
How and why we removed jQuery from GOV.UK
Removing jQuery from GOV.UK was a huge yet manageable task that led to improved code and performance gains across the site. This is how and why we did this work.
What is this in JavaScript? - MadeByMike
My attempt at a very basic explanation of the 'this' keyword in JavaScript.
FormData - Web APIs | MDN
The FormData interface provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the fetch() or XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data".
Wtf is an island and why is it in my website?
Wrapping my head around Islands Architecture.
Designing Better Inline Validation UX — Smashing Magazine
Inline validation in web forms is useful when it works, but frustrating when it fails. Too often it leads to an endless stream of disruptive error messages or dead-ends without any chance of getting out. Let’s fix it.
How to get query string values in JavaScript with URLSearchParams
Accessing and modifying query string values using URLSearchParams
Histoire
Fast stories powered by Vite