News for hackers. Stuff that matters.
Re:Retina.js: Retina graphics for your website by dwnoiz on Friday April 20, 2012 @10:14AM (#3867935)
While this script is fine, it adds an extra HTTP request per image to check for a retina version of the image. Also, the browser will start downloading the small version before it loads the big version (adding another extra http request). Check this easy jQuery snippet that does the same thing, but avoids these issues:

http://www.archer-group.com/2012/development/javascript-jque...

Re:Retina.js: Retina graphics for your website by caseyohara on Friday April 20, 2012 @02:06PM (#3869049)
There are several problems with this implementation.

1. The image doesn't have a src attribute. This means if that script fails for any reason then none of the images on your site load.

2. You need to have width and height attributes on all of your images. This is a nightmare for both dynamically generated content and for responsive designs.

3. You need to have those two extra attributes on each of your image elements in order for it to work.

Our goal was to make retina.js zero-config. We wanted it to work on existing sites without any changes to the existing markup.