How To Lazy Load Homepage Blogger

Discussion in 'Scripts' started by kertoon, Feb 24, 2021.

  1. #1
    I have managed to lazy load the blog posts. But it doesn't work for the homepage with thumbnail pictures.

    I use this code within the body tags:

    <script async='async' data-cfasync='false' defer='defer' type='text/javascript'>
    //<![CDATA[
    const hasSupport = &#39;loading&#39; in HTMLImageElement.prototype;document.documentElement.className = hasSupport ? &#39;pass&#39; : &#39;fail&#39;;document.querySelector(&#39;span&#39;).textContent = hasSupport;
    //]]>
    </script>

    How do I do it?
     
    kertoon, Feb 24, 2021 IP