You can use
navigator.userAgent to check the OS version, but that isn't really the problem here.
What you can do is use media queries to check the actual screen resolution of the device, which might be the cause of the problem at hand.
var isRetina = window.matchMedia("(-webkit-min-device-pixel-ratio: 2)").matches;
<link rel="stylesheet" href="retina.css" media="only screen and (-webkit-min-device-pixel-ratio: 2)" />