Simple and good enough way of detecting a touchscreen — http://t.co/geHoapcWCW
— Nishant Kothary (@rainypixels) September 2, 2013
via http://twitter.com/rainypixels
Discussion on StackOverflow about how to detect a touchscreen
The discussion begins with using the Modernizr library, which tests for touch events in the browser; but notes that since Windows 8 was released some browsers have been erroneously reporting touch support. A number of other alternatives are under discussion.
Best latest version appears to be:
function is_touch_device() { return 'ontouchstart' in window // works on most browsers || 'onmsgesturechange' in window; // works on ie10 };