how to detect, in a cross-browser compatible way, the pixel density of the device visiting a webpage so that one can either serve standard or highres images
I found this:
var retina = window.devicePixelRatio > 1;
this should make retina return true, which you could use an if function to serve the right images.
Source: http://briancray.com/posts/detect-retina-displays-with-javascript
-InfiniDaZa