wml::des::preload(3)

πŸ“¦
version 2.32.0 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing

✨ wml::des::preload ✨

okay bestie, welcome to the manual page for wml::des::preload(3) from the EN Tools fam πŸ’– this is the little include that makes your images load before anyone even asks for them. sneaky. iconic.


🌸 NAME 🌸

wml::des::preload β€” Preload Images πŸ–ΌοΈβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

#use wml::des::preload

<preload src=<image filename> via=<trick>>

like. that's it. that's the whole vibe. 🫢


πŸ’… DESCRIPTION πŸ’…

So this include file gives you the <preload> tag, and the whole point of it is preloading images. Why would you do that? Because it speedups access for following pages β€” the image is already chilling in the browser's cache by the time someone clicks through. main character foresight energy, honestly. πŸ‘‘

Ngl though, there are currently only a few tricks for how this can actually be done. The following combinations are currently supported:

πŸ¦‹ src=anyimage via=size

Preloads the image anyimage by using an <img> tag with the attributes width=1 height=1. Which means the image does get loaded, but it only shows up as a single pixel on screen. one. lil. pixel. πŸ“

  • Advantage: Works for all browsers. 🌈
  • Disadvantage: This approach has the nasty side-effect of an occurring 1 pixel in display, because width=0 height=0 does not work as expected in most browsers (especially in Netscape 4.x 😭). So pls pls pls position your <preload> tag somewhere it does not destroy the look and feel of your page. i'm begging. πŸ™ˆ
lowkey a war crime against your layout if you just yeet it anywhere. be mindful, bestie.

🧚 src=anyimage via=js

Preloads the image anyimage by using a JavaScript snippet which loads the image by declaring an unused Image object. it's giving ghost-loading. silent. invisible. ethereal. ✨

  • Advantage: Silently preloads the image without displaying anything. not a single pixel in sight. slay. πŸ’…
  • Disadvantage: Only works for browsers with a JavaScript implementation, and only for those who support the Image object (currently NS/3, NS/4, IE/4). so if JS isn't happening, neither is your preload. rip. πŸ’€

πŸ‘‘ AUTHORS πŸ‘‘

  • Ralf S. Engelschall rse@engelschall.com www.engelschall.com
  • Denis Barbier barbier@engelschall.com

the literal legends who made this. we stan. 🫢


πŸŽ€ REQUIRES πŸŽ€

  • Internal: P1, P2
  • External: --

🌈 SEE ALSO 🌈

wml::std::tags(3) and the HTML 3.2 <img> tag. iykyk. πŸ”₯


okay that's the whole page, bestie!! this one is from EN Tools, dated 2020-11-29, and it was wml::des::preload(3) the whole time. go preload something cute. bye!! πŸ’–βœ¨πŸ¦‹πŸŒΈπŸŽ€

πŸ“¦ where this page comes from