Tutorials Page 5

  • By
    How to Create a Diff of Two Images

    When I was a child, I loved looking for Waldo in the "Where's Waldo?" book series. These days I'm a sucker for TMZ's "What's the Big Frigin Difference" images, where TMZ slightly changes an image and you have to spot the differences between the two.

  • By
    5 Web Design Trends for 2023 That You Should Pay Attention To

    The start of a new year is usually a time when we start looking for ways to make something a little better. That something could be our life, work, or what we produce. Web designers, for example, might look for ways to make their designs more...

  • By
    fetch with Timeout

    A few years back I wrote a blog post about how write a fetch Promise that times out. The function was effective but the code wasn't great, mostly because AbortController , which allows you to cancel a fetch Promise, did not yet exist. With...

  • By
    Customizing HTML Form Validation

    Form validation has always been my least favorite part of web development. You need to duplicate validation on both client and server sides, handle loads of events, and worry about form element styling. To aid form validation, the HTML spec added some new form attributes...

  • By
    How to Determine a JavaScript Promise’s Status

    Promises have changed the landscape of JavaScript. Many old APIs have been reincarnated to use Promises (XHR to fetch, Battery API), while new APIs trend toward Promises. Developers can use async/await to handle promises, or then/catch/finally with callbacks, but what Promises don't tell...

  • By
    Detect XR Support with JavaScript

    A few years ago I wrote an article about how to detect VR support with JavaScript. Since that time, a whole lot has changed. "Augmented reality" became a thing and terminology has moved to "XR", instead of VR or AR. As such...

  • By
    Document.elementFromPoint

    Reacting to events with JavaScript is the foundation of a dynamic experiences on the web. Whether it's a click event or another typical action, responding to that action is important. We started with assigning events to specific elements, then moved to event delegation...

  • By
    Detect Browser Bars Visibility with JavaScript

    It's one thing to know about what's in the browser document, it's another to have insight as to the user's browser itself. We've gotten past detecting which browser the user is using, and we're now into knowing what pieces of the browser UI users are...

  • Media Temple Hosting
  • By
    JavaScript print Events

    Media queries provide a great way to programmatically change behavior depending on viewing state. We can target styles to device, pixel ratio, screen size, and even print. That said, it's also nice to have JavaScript events that also allow us to change behavior. Did...

  • By
    How to Control CSS Animations with JavaScript

    When it comes to animations on the web, developers need to measure the animation's requirements with the right technology -- CSS or JavaScript. Many animations are manageable with CSS but JavaScript will always provide more control. With document.getAnimations, however, you can use JavaScript to manage...