Results for "davidwalsh.name"

Tags

    • Kyle

      Run once

      Taken from https://davidwalsh.name/essential-javascript-functions "There are times when you prefer a given functionality only happen once, similar to the way you'd use an onload event... ...The once function ensures a given function can only be called once, thus preventing duplic...

      Tags: examples, runonce, davidwalsh.name

      • Kyle

        Get absolute URL

        Taken from https://davidwalsh.name/essential-javascript-functions "Getting an absolute URL from a variable string isn't as easy as you think. There's the URL constructor but it can act up if you don't provide the required arguments (which sometimes you can't). Here...

        Tags: examples, URL, davidwalsh.name

        • Kyle

          Applying styles to selectors - insertRule()

          Taken from https://davidwalsh.name/essential-javascript-functions "...we can grab a NodeList from a selector (via document.querySelectorAll) and give each of them a style, but what's more efficient is setting that style to a selector (like you do in a stylesheet)... This is espec...

          Tags: examples, CSS, davidwalsh.name

          • Kyle

            Polling

            Taken from https://davidwalsh.name/essential-javascript-functions "...sometimes you don't get to plug into an event to signify a desired state -- if the event doesn't exist, you need to check for your desired state at intervals. Polling has long been useful on the web and wil...

            Tags: examples, polling, davidwalsh.name

            • Kyle

              Debounce

              Taken from https://davidwalsh.name/essential-javascript-functions "The debounce function can be a game-changer when it comes to event-fueled performance. If you aren't using a debouncing function with a scroll, resize, key* event, you're probably doing it wrong. Here's a ...

              Tags: examples, debounce, davidwalsh.name