In the past, when detecting whether a device supports touch events in JavaScript, we could do something like this:
var touch_capable = (\'ontouchstart\' in d
The correct answer is to handle both event types - they're not mutually exclusive.
For a more reliable test for touch support, also look for window.DocumentTouch && document instanceof DocumentTouch which is one of the tests used by Modernizr
Better yet, just use Modernizr yourself and have it do the feature detection for you.
Note though that you cannot prevent false positives, hence my first line above - you've got to support both.