David Walsh Tutorials
![How to Prevent Pasting into an Input]()
How to Prevent Pasting into an Input
Every once in a while I get to a website that doesn't allow me to paste into a form input. In most cases it's something to do with login credentials (username and or password) and auth codes. So how are they preventing me from...
![Sports Data for Developers: SportdataAPI]()
Sports Data for Developers: SportdataAPI
Most of the side projects I consider starting revolve around sports, since I'm a huge sports fan. I spend my Saturdays watching soccer, Sundays spent watching soccer and NFL, and of course the mid-week Champions League and Europa League matches. One problem I've...
![39 Shirts – Leaving Mozilla]()
39 Shirts – Leaving Mozilla
In 2001 I had just graduated from a small town high school and headed off to a small town college. I found myself in the quaint computer lab where the substandard computers featured two browsers: Internet Explorer and Mozilla. It was this lab where I fell...
![Curate Custom Content with mediastack]()
Curate Custom Content with mediastack
I used to have a personal aggregator of sites I enjoyed but maintaining it was a nightmare. I needed to grab each site's RSS feed, categorize their contents, deal with errors and individual rate limits, etc. I had to tear the whole project down because it...
![How to Detect When a Sticky Element Gets Pinned]()
How to Detect When a Sticky Element Gets Pinned
The need for
position: stickywas around for years before it was implemented natively, and I can boast that I implemented it with JavaScript andscrollevents for ages. Eventually we gotposition: sticky, and it works well from a visual perspective, but I wondered how...![How to Detect the Default Branch in a git Repository]()
How to Detect the Default Branch in a git Repository
Over the past few years, many engineering teams have switched their default git branch name from
masterto a different, potentially less offensive term. I'm all for choosing to name your default branch whatever you'd like, but not having a universal default branch name can...![How to Create an Async Function via “new Function”]()
How to Create an Async Function via “new Function”
One thing I love about JavaScript is that there are many ways to accomplish the same task, one such example being creating functions. There are several patterns for functions; one of the last you see used is the
new Functionmethod:What if you want...![Remove the Search Input Clear(x) Icon]()
Remove the Search Input Clear(x) Icon
I really appreciate the amount of different
<input>elements we've received over the past decade. These elements don't just bring a new semantic advantage, but also provide UI helpers, which in many cases are useful. In a recent case, I found a UI element...![5 Awesome JavaScript Promise Tricks]()
5 Awesome JavaScript Promise Tricks
The Promise API changed the game in JavaScript. We went from abusing
setTimeouts and settling for synchronous operations to doing everything possible to leverage this new async API. Let's check out a handful of awesome Promise API tricks!Cancel a fetch RequestOne problem we...![Logical Assignment Operators]()
Logical Assignment Operators
I love JavaScript, it's my favorite programming language, but I love dipping into other languages because they offer a new perspective on coding paradigms. There've been syntax additions to JavaScript that I've seen I found interesting (think
??in optional chaining) and...







