Take the 2-minute tour ×

I want to lazyload some of the images on a page. Therefore I need to put the image url into a data-url attribute, but my <img> tags are generated by wordpress:

So I'm thinking to use js to change my <img> tags before the page loads - However, will the HTTP requests for the images already have been made [or put in a queue] by the time my js script runs?

(I know its a rather hack solution, but I can't work out a better way to change the wordpress generated <img> tags)

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Rendering is synchronous, so yes, your images will have already been processed/requested by that point. I found a really good resource for understanding this here:


I hope that helps. :)

share|improve this answer
So even tho HTML spec is synchronous the speculative parsing by modern browsers will have made those requests. I see, thanks. –  iiz Aug 15 '12 at 16:17

Your Answer


