title: detect screen density using javascript on mobile devices?
body: <p>I was wondering if it is possible to detect the screen density from a web page by using javascript and/or some sort of server checking based on http headers on PHP. My goal is to check if the user is accessing the site from a tablet, phone or computer to adjust some button sizes - imagens on a html5 canvas. Exact pixel values may lead to buttons too small or too big depending on the screen density...</p>