Check this way of doing it to avoid extra http requests. http://www.archer-group.com/2012/development/javascript-jque...
Our goal with retina.js was to make it zero-config: no markup changes, no extra element attributes or flags.
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.