Mon, 15 Apr 2024 11:19:02 +0000

Modals have been an important part of websites for two decades. Stacking contents and using fetch to accomplish tasks are a great way to improve UX on both desktop and mobile. Unfortunately most developers don’t know that the HTML and JavaScript specs have implemented a native modal system via the popover attribute — let’s check […] The post HTML popover Attribute appeared first on David Walsh Blog.

Mon, 25 Mar 2024 21:50:46 +0000

AI media creation has expanded to incredible video art and a host of other important improvements, and LimeWire is leading the way in creating an awesome interface for the average user to become an AI artist. Limewire has just released its Developer API, a method for engineers like us to create dynamic AI art on […] The post Get Started in AI and NFTs with the Limewire API (Sponsored) appeared first on David Walsh Blog.

Mon, 18 Mar 2024 13:00:20 +0000

Time can be a funny thing. I still remember discovering HTML, CSS, and JavaScript coding. I still remember my first college programming course. I still remember my first day at my first coding job, then my first day at my second coding job, and then my first day at Mozilla. I still remember my first […] The post I’m So Old: Web Edition appeared first on David Walsh Blog.

Tue, 06 Feb 2024 10:33:10 +0000

Anyone is capable of having their caps lock key on at any given time without realizing so. Users can easily spot unwanted caps lock when typing in most inputs, but when using a password input, the problem isn’t so obvious. That leads to the user’s password being incorrect, which is an annoyance. Ideally developers could […] The post Detect Caps Lock with JavaScript appeared first on David Walsh Blog.

Mon, 05 Feb 2024 11:28:01 +0000

One of the HTML elements that frequently comes into collision with CSS is the img element. As we learned in Request Metrics’ Fixing Cumulative Layout Shift Problems on DavidWalshBlog article, providing image dimensions within the image tag will help to improve your website’s score. But in a world where responsive design is king, we need […] The post How to Override width and height HTML attributes with CSS appeared first on David Walsh Blog.

Wed, 24 Jan 2024 11:56:41 +0000

Over 50 thousand developers visit DavidWalshBlog every month from around the world to learn JavaScript tricks and fix problems in their code. Unfortunately, some of them have a slow experience on the site. David tracks the performance of his Core Web Vitals and overall performance with Request Metrics. Recently, we noticed that his CLS performance […] The post Fixing Cumulative Layout Shift Problems on DavidWalshBlog appeared first on David Walsh Blog.

Wed, 17 Jan 2024 12:06:16 +0000

Ask any software engineer and they’ll tell you that coding date logic can be a nightmare. Developers need to consider timezones, weird date defaults, and platform-specific date formats. The easiest way to work with dates is to reduce the date to the most simple format possible — usually a timestamp. To get the immediate time […] The post Date.now() appeared first on David Walsh Blog.

Tue, 16 Jan 2024 11:48:41 +0000

User input from HTML form fields is generally provided to JavaScript as a string. We’ve lived with that fact for decades but sometimes developers need to extract numbers from that string. There are multiple ways to get those numbers but let’s rely on regular expressions to extract those numbers! To employ a regular expression to […] The post Extract a Number from a String with JavaScript appeared first on David Walsh Blog.

Mon, 15 Jan 2024 11:08:32 +0000

Streaming services have revolutionized content delivery, sending linear media companies into a panic as they watch traditional cable services decay. “Cutting the cord” is a common practice these days, but the streaming landscape isn’t perfect. We’re a decade into streaming so I wanted to share my thoughts on the state of new media: first impressions, […] The post Thoughts on Streaming Services: 2024 Edition appeared first on David Walsh Blog.

Mon, 18 Dec 2023 11:55:51 +0000

As the demands of the web change and developers experiment with different user experiences, the need for more native language improvements expands. Our presentation layer, CSS, has done incredibly well in improving capabilities, even if sometimes too slow. The need for native support for automatically expanding textarea elements has been long known…and it’s finally here! […] The post AutoGrow Textareas with CSS appeared first on David Walsh Blog.

Tue, 28 Nov 2023 00:35:41 +0000

The underground world of creating and streaming Super Mario World-based ROM hacks continues to gain popularity. This popularity is a tribute to the creativity of gamers and the quality of the original 30 year old video game’s mechanics. Over the past decade, incredible ROM hacks like Grand Poo World 1 and 2, Invictus, and Dram […] The post How to Play Grand Poo World 3 appeared first on David Walsh Blog.

Sat, 28 Oct 2023 18:54:30 +0000

Most developers spoil themselves with fun command line utilities to make their work easier and more efficient. One such command line helper allows developers to always show the git branch in the command line. How can you get the current branch? With this handy snippet: git branch --show-current It’s great to keep this snippet around […] The post How to Get the Current Branch Name with git appeared first on David Walsh Blog.

Mon, 23 Oct 2023 11:33:21 +0000

Visual Studio Code has taken the crown of most used text editor, at least in JavaScript spheres. VSCode is fast, feature-filled, and supports thousands of plugins to boost productivity. Developers can also tweak hundreds of settings to enrich functionality. One such feature is the autoSave feature. To autoSave files with VS Code, you can add […] The post AutoSave with VSCode appeared first on David Walsh Blog.

Mon, 02 Oct 2023 13:37:25 +0000

One of the best things that ever happened to t he user experience of the web has been web extensions. Browsers are powerful but extensions bring a new level of functionality. Whether it’s crypto wallets, media players, or other popular plugins, web extensions have become essential to every day tasks. Working on MetaMask, I am […] The post How to Detect Failed Requests via Web Extensions appeared first on David Walsh Blog.

Fri, 22 Sep 2023 00:35:11 +0000

LimeWire was a staple of my youth. LimeWire was software that allowed users to share any type of file during the revolutionary days of file sharing. Fast forward to today and LimeWire is back, again as revolutionary software, but this time in the field of AI content publishing. From creating images to music and video, […] The post Welcome to the New LimeWire: AI Media Generation (Sponsored) appeared first on David Walsh Blog.

Tue, 12 Sep 2023 10:54:26 +0000

You’ve visited countless websites, and now you’re designing your own. Stop and think for a minute about what you’ve liked and didn’t like about some of those you visited. Was it the front page, the layout in general, or the functionalities that either met with your satisfaction or turned you off? The helpful tools and […] The post Unveiling 15+ Essential Tools & Resources for Web Designers and Agencies in 2023 (Sponsored) appeared first on David Walsh Blog.

Thu, 07 Sep 2023 02:06:45 +0000

It’s rare that I’m disappointed by the JavaScript language not having a function that I need. One such case was summing an array of numbers — I was expecting Math.sum or a likewise, baked in API. Fear not — summing an array of numbers is easy using Array.prototype.reduce! const numbers = [1, 2, 3, 4]; […] The post Sum an Array of Numbers with JavaScript appeared first on David Walsh Blog.

Mon, 14 Aug 2023 10:08:16 +0000

As more of the JavaScript developers write becomes asynchronous, it’s only natural to need to wait for conditions to be met. This is especially true in a world with asynchronous testing of conditions which don’t provide an explicit await. I’ve written about waitForever, waitForTime, and JavaScript Polling in the past, but I wanted to have […] The post JavaScript waitFor Polling appeared first on David Walsh Blog.

Fri, 11 Aug 2023 17:01:26 +0000

One of the larger downloads when requesting a webpage are custom fonts. There are many great techniques for lazy loading fonts to improve performance for those on poor connections. By getting insight into what fonts the user has available, we can avoid loading custom fonts. That’s where queryLocalFonts comes in — an native JavaScript function […] The post queryLocalFonts appeared first on David Walsh Blog.

Mon, 07 Aug 2023 10:42:21 +0000

Web debugging tools are so incredibly excellent these days. I remember the days where they didn’t exist and debugging was a total nightmare, even for the simplest of problems. A while back I introduced many of you to Logpoints, a way to output console.log messages without needing to change the source files. Another great breakpoint […] The post Use XHR/fetch Breakpoints! appeared first on David Walsh Blog.