ApoorvSaxena / ApoorvSaxena/lozad.js

Images not loading (data-loaded tag is injected, but no src tag)

Open
#220 3 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.