On 3 Jan 2022, at 6:44, Harriet Bazley wrote:
How are these images supposed to work?
[https://www.phantomlibrary.com/macabre-mystery-curse-of-the-nightingal](https://www.phantomlibrary.com/macabre-mystery-curse-of-the-nightingal)
First rule of the web: There's nothing you can't ruin with JavaScript.
Apparently, after loading 100s of K of JavaScript source code (at least
it's < 1MB, small mercies!) that runs in your web browser using up your
computer's resources, those smart developers at Wix realised - IDK -
that the big thing causing slow loading times is *images*, because
Reasons, maybe? Or they just wanted fancy loading transitions and hadn't
heard of CSS. Whatever.
They built a very over-complicated JavaScript system, that uses a custom
element wrapping a standard IMG tag in the hope that a browser will
ignore the outer custom element but render whatever it wraps. So, the
browser renders the standard `img` tag, which contains a low resolution
blurred preview of the actual image. JavaScript code looks for the
custom `wix-image` elements and parses parameters in the various `data`
attributes to work out how it's supposed to load and show the full
resolution image to the user.
One of the delightful side-quests is implementation of the "feature"
wherein an image doesn't load until I scroll down to wherever it is
showing on the page. I get to experience the joy of waiting for images
to load over and over again, rather than the browser just loading them
all when it fetches the page so that I can get on with viewing it
without further delays or interruptions.
There is almost no universe in which this is better or faster than just
letting the web browser load the original image directly, with the web
site building providing a precise at-in-page-resolution copy of the
image for the page and optionally a click-through to the full resolution
version, if available and if permitted by the person who put the web
site together.
--
TTFN, Andrew Hodgkinson
Find photos, software, music and more at my home site, Bandcamp and
GitHub:
https://pond.org.uk / https://pondnz.bandcamp.com /
https://github.com/pond
_______________________________________________
netsurf-users mailing list -- netsurf-users@netsurf-browser.org
To unsubscribe send an email to netsurf-users-le...@netsurf-browser.org