ApoorvSaxena / ApoorvSaxena/lozad.js
Images not loading (data-loaded tag is injected, but no src tag)
Open
- Dominant language
- JavaScript
- Stars
- 7.5k
- Forks
- 435
- PR merge metrics
- No merged PRs in 30d
Description
I have installed lozad.js, but no images are loaded. lozad.js has been installed through npm.
Here’s the JS code.
```
const observer = lozad('.lozad', {
load: function(el) {
console.log('Loading element');
console.log(el);
},
});
observer.observe();
```
And the HTML markup.
``
lozad.js is triggered. I get console logs with the right elements, and `data-loaded="true"` is injected in the appropriate `` tag. But no `src` is injected, no image is loaded.
The `` tag looks like this once lozad.js is triggered.
``
I am lost here, any idea?
Contributor guide
Assessment
This issue has not been assessed yet.