4 ms·
Check this way of doing it to avoid extra http requests. http://www.archer-group.com/2012/development/javascript-jquery-snippet-for-doing-retina-resolution-imag
by dwnoiz 14y ago
Check this way of doing it to avoid extra http requests. http://www.archer-group.com/2012/development/javascript-jquery-snippet-for-doing-retina-resolution-images http://www.archer-group.com/2012/development/javascript-jque...
- caseyohara 14y agoThat is certainly the ideal way to reduce the HTTP requests. The problem with this implementation is clear: without a 'src' attribute on your images, if your script fails then your site suddenly has no images at all. Not to mention the overhead of manually modifying all of your existing markup. Our goal with retina.js was to make it zero-config: no markup changes, no extra element attributes or flags.
- oops 14y agoThe Stripe gallery posted here the other day[1] used src-less img tags for lazy loading. It looks like they handle the script issue by having the normal img tag (with src attribute) nearby in a noscript block. Doesn't really do much to help with the overhead of modifying existing markup. Perhaps if you're already using something like image_tag in Rails, a retina_image_tag helper might not be too much of a stretch. 1: https://stripe.com/gallery https://stripe.com/gallery