user31782
user31782

Reputation: 7589

Are images in data-src attributed downloaded on page load?

In the Lazy Load plugin we mention the src of image in the data-original custom attribute. Now after the dom is ready javascript transfers the link mentioned in data-original attribute to src attribute. My question is,

Would the browser start downloading the image only after javascript transfers the url to src attribute? Or are the images mentioned in data-original attribute downloaded on just loading the page and js only renders them after the dom is ready?

Upvotes: 1

Views: 591

Answers (1)

Wax Cage
Wax Cage

Reputation: 788

Only when the attribute name is src, browser downloads the source. Data-attributes have no special meaning for browser.

Upvotes: 2

Related Questions