Skip to content
Advertisement

How to detect the screen DPI using JavaScript

The only way I found till now, is getting the offsetWidth, offsetHeight of a test div element with height and width of one inch: http://www.infobyip.com/detectmonitordpi.php

Is there a way to detect the screen DPI via JavaScript instead?

Thanks,

Atara.

Advertisement

Answer

JavaScript

Then you can use JQuery to send dpi_x and dpi_y this to to your server

http://jsfiddle.net/sxfv3/

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement