Event delegation is a pattern where a container element has a single event listener that handles events for all descendants...

Haml 6 was a major rewrite with performance in mind. To achieve a performance improvement of 1.7x, some design...

jQuery has a function $.fn.trigger(). You can use it to dispatch an event on a jQuery object: let $element = $('.foo...

DirectUpload allows you to upload files to your file storage without having to wait for the form to submit. It...

When building a web application, one is tempted to claim it "done" too early. Make sure you check this list...

Checking if a JavaScript value is of a given type can be very confusing: There are two operators typeof and...

Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...

To allow HTTP 304 responses, Rails offers the fresh_when method for controllers. The most common way is to pass...

validates_uniqueness_of is not sufficient to ensure the uniqueness of a value. The reason for this is that in...

A HTTP 302 Found redirect to PATCH and DELETE requests will be followed with PATCH or DELETE. Redirect responses to...

When projects run for many years, they require special regular maintenance to stay fresh. This kind of maintenance is usually...

Most forms have a single submit button that will save the record when pressed. Sometimes a form needs additional submit...

When testing JavaScript functionality in Selenium (E2E), you may need to access a class or function inside of a evaluate...

JavaScript has no built-in functions to compare two objects or arrays for equality of their contained values.

To keep JavaScript sources small, it can sometimes make sense to split your webpack bundles. For example, if your website...

jsbin.com

If you try to listen to events on elements that are nested inside a , Firefox will stop event propagation once...

Speaker today is Henning Koch, Head of Development at makandra. This talk will be in German with English slides.

Rails has always included a scaffold script that generates a default controller implementation for you. Unfortunately that generated controller is...

Browsers come with a set of built-in elements like or . When we need a new component not covered by...

When you need to add a event listener to hundreds of elements, this might slow down the browser. An alternative...

When we write a form with date fields, we often use graphical data picker like Rome to get a consistent...

Find-as-you-type boxes are usually built by observing changes in a text field, and querying the server via...

shoelace is a library of web components. Here is a proof of concept how a integration (slightly different as the...

developer.mozilla.org

When building a form with a file select field, you may want to offer your users a live preview before...