1'use strict' 2var lazyLoad = function () { 3 var lazyImages = Array.from(document.querySelectorAll('img.lazy')) 4 lazyImages.forEach(function (lazyImage) { 5 if (lazyImage.dataset && lazyImage.dataset.src) { 6 // fetch the image to the browser cache 7 fetch(lazyImage.dataset.src, { mode: 'no-cors' }) 8 .then(function () { 9 // replace the new image with the placeholder 10 lazyImage.src = lazyImage.dataset.src 11 }) 12 .catch(function () { 13 console.warn('Failed to fetch', lazyImage.dataset.src) 14 }) 15 } 16 }) 17} 18setTimeout(function () { 19 lazyLoad() 20}, 200)
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.