GET DPI
Get DPI from javascript
by bsorrentino
JavaScript
//
// inspired by https://stackoverflow.com/a/838755/521197
//
function getDPI() {
var div = document.createElement( "div");
div.style.height = "1in";
div.style.width = "1in";
div.style.top = "-100%";
div.style.left = "-100%";
div.style.position = "absolute";
document.body.appendChild(div);
var result = div.offsetHeight;
document.body.removeChild( div );
return result;
}
alert( " DPI: " + getDPI());