How to Avoid For Loops that Manipulate the DOM in Javascript
For loops that interact with and manipulate the DOM can be a huge performance buster, depending on what is going on. But let’s look at best practices anyway and write better code.
I enjoy helping people optimize websites and software while living in the countryside town of Goseong in Gyeongnam, South Korea.
Let's GIT 'ER OPTIMIZED!
For loops that interact with and manipulate the DOM can be a huge performance buster, depending on what is going on. But let’s look at best practices anyway and write better code.
Using addEventListener to handle scroll and resize events is convenient, but it might be costing your application more than your realize in terms of performance.
This is what I wish I understood when I first was adding JavaScript to a website.
We all want to lazy load images below the fold for best performance. But what if an image is ABOVE the fold on desktop, but BELOW the fold on mobile?
If you want use icons on your site without loading a bulky dashicons.min.css file, remove dashicons and use HTML entities or emoji codes instead.
Photos are typically the heaviest components of a webpage to load, so it is important to optimize them correctly. There is quite a bit to image optimization, but in this post we just look at compression.
I wanted to delay jQuery and all scripts that depend on it until user interaction. Every solution I tried had a problem, until the solution I found to actually work for me.