DEV Community

Discussion on: How to lazy-load images? The easiest way to lazy-load images on your website! 🖼

Collapse
 
hasnaindev profile image
Muhammad Hasnain

Thank you for sharing this! Yes, browsers natively support lazy-loading and they also natively support dynamic imports for scripts. The issue is browser compatibility and making sure that the site runs smoothly in case someone is using an older browser.

If supporting older browsers isn't a priority for you then the loading attribute you mention is a better choice. Please, look into support for the loading attribute here: caniuse.com/?search=lazy%20loading