From 1b14996290f228a329d83c164e50c27364cc0a22 Mon Sep 17 00:00:00 2001 From: altaf-creator Date: Sat, 13 Jun 2026 19:06:09 +0800 Subject: blog in progress, NOT READY FOR PROD --- www/scripts/iframe.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 www/scripts/iframe.js (limited to 'www/scripts/iframe.js') diff --git a/www/scripts/iframe.js b/www/scripts/iframe.js new file mode 100644 index 0000000..68eff8d --- /dev/null +++ b/www/scripts/iframe.js @@ -0,0 +1,11 @@ +function iframeLoad(id) { + const iframeContainer = document.getElementById(id); + const iframes = iframeContainer.querySelectorAll(":scope > iframe"); // this a NodeList + const warning = iframeContainer.querySelector(".iframe-manual-warning"); + + warning.remove(); + + iframes.forEach((frame, _) => { + frame.setAttribute("src", frame.getAttribute("data-src")); + }); +} -- cgit v1.2.3