Building Things

double ended queue

Relative Reference URLs

It’s possible to use relative reference in URLs, for example when redirecting. That means that //example.com is a valid url

Defined in RFC 3986: https://datatracker.ietf.org/doc/html/rfc3986#section-4.2


Changed from: document.addEventListener('keydown', handler) to: document.addEventListener('keydown', handler, true)

The true parameter makes the event listener use the capture phase instead of the bubble phase.

Event flow in the DOM has three phases:

  1. Capture phase (from document down to target)
  2. Target phase (on the element itself)
  3. Bubble phase (from target back up to document)