The History of DOM Manipulation Performance in a Nutshell | by Davi Albuquerque Vieira | Aug, 2022

Updating the DOM directly is costly. How do we know what we know today? image by author The year was 1998. I was a ten years old kid, disappointed by the recent defeat of Brazil against France in the World Cup’s final. Big day for French people, especially for football fans. Not less important but … Read more

javascript – How to calculate text height without rendering anything to the DOM?

I’m leveraging a virtualized list (react-virtualized) where the heights of my varying list items are required and could greatly. Due to large variations, any height estimation I give the library yields a poor experience. The usual method for height calculation goes something like this: const containerStyle = { display: “inline-block”, position: “absolute”, visibility: “hidden”, zIndex: … Read more

javascript – How can I access the DOM within an iFrame

Chrome has default security restrictions that don’t allow you to access other windows from the hard disk even though they are technically the same origin. There is a flag in Chrome that can relax that security restriction (command line argument on Windows is what I remember), though I wouldn’t recommend running with that flag for … Read more

javascript – Why does jQuery or a DOM method such as getElementById not find the element?

The element you were trying to find wasn’t in the DOM when your script ran. The position of your DOM-reliant script can have a profound effect on its behavior. Browsers parse HTML documents from top to bottom. Elements are added to the DOM and scripts are (generally) executed as they’re encountered. This means that order … Read more