It drives me bonkers! The browser already has a way to display loading and it’s even respectful of back buttons.
I get that in a select few cases, for real time content, it makes sense to handle the loading inside the page. But if all you’re doing is displaying an article, I don’t need you to load a framework page that then loads the content. Just load the content.
You mean like when an HTP request is not completely fulfilled? Is there an API for this “native” loading display of the browser?
You can tell by the shooting stars behind the big “N”.
If your element has an id, you can just reference it from the window scope. The
const page =is useless. Also the body has its own reference under document:document.bodyreplacesdocument.querySelector('body')If your element has an id, you can just reference it from the window scope
This is brittle, as defining a global variable with the same name (or the browser adding a API with the same name) will override it. This functionality was only kept for backwards compatibility with sites designed for Internet Explorer. The spec says to use
getElementByIdinstead.
I have no clue what any of it means.
“make the page transparent and show a spinning icon, wait 750ms, then make the page display normally”
it’s a fake loading screen
Why are you using
Node.removeChildfor? Are you trying to support a 13 year old browser? Switch toElement.removeLack of knowledge I guess. Which is why I like posting code on the internet. Thanks for the tip!




