4

On the desktop version of the chrome 29, the "window.Touch" is no longer set to 'undefined' this is a problem because I used it to detect if my app is running on a touch device .

Is there an alternative solution ?

thanks

mLar
  • 2,967
  • 2
  • 22
  • 23
  • Possible duplicate of [What's the best way to detect a 'touch screen' device using JavaScript?](http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript) – Frédéric Hamidi Aug 27 '13 at 07:44

2 Answers2

2

Yes, use 'ontouchstart' in document.documentElement [source: How to check browser for touchstart support using JS/jQuery? ]

var isTouchDevice = 'ontouchstart' in document.documentElement;

or

if('ontouchstart' in document.documentElement) {
  //do something with touch stuff
}

A lot more detailed answers and more specific solutions here: What's the best way to detect a 'touch screen' device using JavaScript?

Community
  • 1
  • 1
fregante
  • 29,050
  • 14
  • 119
  • 159
-1

Maybe window.Touch.length is a solution for this problem?