From 6b2e0758626e4af65177cb41980c1fef442eb719 Mon Sep 17 00:00:00 2001 From: Nathaniel Sabanski Date: Sat, 6 Jul 2024 10:21:48 -0700 Subject: [PATCH] Added more usage, alternative patterns of onloadAdd --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b1f8d45..86c8364 100644 --- a/README.md +++ b/README.md @@ -265,9 +265,13 @@ Looking for stuff [we recommend doing in vanilla JS](#no-surreal)? * Alias of vanilla `document.createElement` * 🌐 `onloadAdd` 🌗 `onload_add` 🌗 `addOnload` 🌗 `add_onload` * 🔥 `onloadAdd(_ => { alert("loaded!"); })` + * 🔥 `` * Execute after the DOM is ready. Similar to jquery `ready()` - * Queues functions onto `window.onload` - * Why? So you don't overwrite `window.onload`, also predictable sequential loading! + * Adds function to `window.onload` to prevent overwrites of `window.onload` and predictable sequential loading. + * Alternative patterns + * Skip missing elements using `.?` example: `me("video")?.requestFullscreen()` + * Place `