Lazy Loading (original) (raw)

Last Updated : 2 May, 2026

Lazy loading is a performance optimization technique that loads resources only when they are needed.
It helps improve initial load time and overall efficiency in modern JavaScript applications.

Reasons to Use Lazy Loading

Lazy loading provides several benefits, such as

Working of Lazy Loading in Images

Lazy loading in JavaScript loads images or videos only when they’re about to be seen on the screen. This speeds up page load times and saves bandwidth. This can be done using

Lazy Loading Images using Intersection observer API

This code implements lazy loading in JavaScript with the help of Intersection Observer API. It is an API that helps load images after the UI is rendered. It is used to halt the general nature of loading for images.

HTML `

Lazy Loading Images

Image1

`