retina.js
JavaScript helpers for rendering high-resolution image variants
...You can prepare images for as many levels of pixel density as you want and let retina.js dynamically serve the right image to the user. retina.js assumes you are using Apple's prescribed high-resolution modifiers (@2x, @3x, etc) to denote high-res image variants on your server. It also assumes that if you have prepared a variant for a given high-res environment, that you have also prepared variants for each environment below it. For example, if you have prepared 3x variants, retina.js will assume that you have also prepared 2x variants. If the environment does have 3x capabilities, retina.js will serve up the 3x image. ...