I have long wished that some kind of lazy loading mechanism can be incorporated into DokuWiki core. (lazy loading of
iframes at least)
Before that happens, a plugin is needed, or at least as I just read yesterday, a userscript or "pseudo-plugin" is needed.
I have found a similar thread 5 years ago being the latest and nearest result in this field (only dealing with images, and did not seem to work out eventually):
Help me developing a lazy load plugin - DokuWiki User Forum
And I regret that this thread is what we have got so far.
I have found a newer jQuery plugin:
emn178/jquery-lazyload-any: A jQuery plugin provides a lazyload function for images, iframe or anything.
I have created a pseudo-plugin to contain that script and installed that in my DW instance, but nothing seems to work yet.
So far I just use a jQuery class selector to try to invoke jquery.lazyload-any functions on div.lazyload:
dokuwiki-plugin-lazyload/script.js at master ยท GJRobert/dokuwiki-plugin-lazyload, and on DW test page I use the following codes:
<html><div class="lazyload">
...<!-- some long paragraphs -->
<!--
<iframe src="https://www.dokuwiki.org/plugin:localization"></iframe>
-->
</div></html>
But the script does not seem to load at all according to my browser console, and unfortunately my knowledge of JavaScript is far fewer than enough to figure out what's wrong.
Could you kindly give your insight on this?