Using MVC 4.5 ...
I'm trying to prepare my website for retina screens.
How can I from codebehind (code on server) detect, if user has a Retina screen?
I would prefer not to do it from java, but from code on server.
Using MVC 4.5 ...
I'm trying to prepare my website for retina screens.
How can I from codebehind (code on server) detect, if user has a Retina screen?
I would prefer not to do it from java, but from code on server.
Retina Display is a brand name and not tightly defined. It sounds like you want to detect whether it is a newer version of iPad or not. Details on detecting those are widespread.
Try this:
(function(){
if( document.cookie.indexOf('device_pixel_ratio') == -1
&& 'devicePixelRatio' in window
&& window.devicePixelRatio == 2 ){
document.cookie = 'device_pixel_ratio=' + window.devicePixelRatio + ';';
window.location.reload();
}
})();