Skip to content

Commit

Permalink
Fix lazy loading examples (#31183)
Browse files Browse the repository at this point in the history
"loading" attribute must be placed before "src" - https://bugzilla.mozilla.org/show_bug.cgi?id=1647077
  • Loading branch information
anewuser authored Dec 20, 2023
1 parent 1c44eb0 commit 9bbf5b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/en-us/web/performance/lazy_loading/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ The [`loading`](/en-US/docs/Web/HTML/Element/img#loading) attribute on an {{HTML
This allows non-critical resources to load only if needed, potentially speeding up initial page loads and reducing network usage.

```html
<img src="image.jpg" alt="..." loading="lazy" />
<iframe src="video-player.html" title="..." loading="lazy"></iframe>
<img loading="lazy" src="image.jpg" alt="..." />
<iframe loading="lazy" src="video-player.html" title="..."></iframe>
```

The `load` event fires when the eagerly-loaded content has all been loaded. At that time, it's entirely possible (or even likely) that there may be lazily-loaded images or iframes within the {{Glossary("visual viewport")}} that haven't yet loaded.
Expand Down

0 comments on commit 9bbf5b1

Please sign in to comment.