ApoorvSaxena / lozad.js

🔥 Highly performant, light ~1kb and configurable lazy loader in pure JS with no dependencies for responsive images, iframes and more
https://apoorv.pro/lozad.js/demo/
MIT License
7.45k stars 447 forks source link

tried script with following code and images completely disappeared. #240

Open inglesuniversal opened 4 years ago

inglesuniversal commented 4 years ago

IMPORTANT: Code has been in use for over a year... but loading times for over 70 logos is not what I want

--> setup lozad.js

const observer = lozad(); // lazy loads elements with default selector as '.lozad' observer.observe();

--> fetch json file with radio stations...

--> looped through every record which has the StationNameLogo.png for every radio station

data.forEach(obj => { $('tbody').append("<tr id="+counter+"><td class=\"label-cell\"><button onclick=\"playStation("+counter+");\"><img class=\"lozad stationlogo\" data-src="+stationLogo+"></button></td><td class=\"label-cell\">"+channel+"</td><td class=\"label-cell\">"+genre+"</td></tr>"); } else { offLine++; } }); });

--> images simply disappear and no error is shown on console.logs

Any pointers or suggestions.

STAY SAFE --> the world needs Developers like you!

ApoorvSaxena commented 4 years ago

@inglesuniversal Codepen sample would be appreciated to debug