Logo BrocksiNet

BrocksiNet

Try to clean the web

JavaScript

02.12.2021
javascript
How to find DOM elements with a lot of childs?

When you think about the core web vitals then you will find this claim "Avoid an excessive DOM size". This is easy to say, but sometimes hard to achieve. Also the page about DOM-size at web.dev gives you only some general advices. When you once had a page that is really slow, just because someone created a quantity select element with over 500 options for every product on a category page with 48 products. And then Lighthouse tells you that the DOM size should be below 12.000 elements. After clea

25.11.2021
javascript
Remix.run - SSR, nested routes, eliminate loading state

Every day a new javascrip framework 🎉 But this day we have one that is the top 1 trending repository (at 2021-11-24) at github 🤩 from the creators of the react router peps (used by over 2.8 mil.). So what has Remix to over? Key features Remix React, Typescript Server-Side-Rendering (SSR) Nested routes 🤯 Eliminate loading state Instant data updates Forms (with transitions hooks) Error boundary Works when JS is disabled Scoped css Remix Demo You can play around wi

01.08.2017
javascript
JavaScript check if pending ajax calls exist

Sometimes you have to wait until some ajax calls are finished. And then you want to execute some JavaScript code on that new objects that where putted in from the ajax call. To check if there are activeRequests you can use window.Ajax.activeRequestCount. And to re-check if they are now finished you can use window.setInterval. Important is also to clear the intervalID with window.clearInterval(intervalID). Here is a small code snippet // we need to wait for ajax calls to be finished var intervalI