4 ms·
> How can a skillful JS developer make the site better for me when I want to avoid ANY extra features and distractions? I don't know if I qualify as a skillful
by jraph 9y ago
> How can a skillful JS developer make the site better for me when I want to avoid ANY extra features and distractions?
I don't know if I qualify as a skillful JS developer, but I run a website displaying pictures that works correctly without Javascript.
However, Javascript makes this website way faster, smoother and easier on the connection by downloading only the moving parts when clicking on a link, carefully preserving history so back/next works as if this script did nothing. When Javascript is disabled, an ugly white flash appears when navigating between some pages and rendering is just slower, even though it remains decent (my code is minimalist anyway…)
When leaving the page of a picture to come back to the album it is in, scroll position is restored. This is impossible without Javascript. History Back button is not sufficient: you might have looked at 10 pictures before coming back to the album. Sure, you can still ask your browser to come back 10 pages ago, but this is less convenient than just clicking on a cross.
It also help dimension images correctly, which I could not manage to do using pure CSS, unfortunately.
No Javascript tracker is present. You want Javascript enabled on this website because it helps using less resources and makes things easier to use. This is a 9 KB Javascript file that gets compressed to 3 KB and served using HTTP2 only once, so this is basically a null cost when considering how much a picture weighs (~ 100KB). And this is free software, for the sake of it.
But you cannot know this on random websites. Problem is, Javascript is not used like this in general. Unfortunately for websites like this one, disabling Javascript by default is still a reasonable thing to do.
Worse, visitors of this website that disable Javascript won't be aware of that, because things pretty much work as expected and I don't display a warning message.