May 21, 2014

Feature detection in modern js

Most html5 features rely on 'xxx' in window for feature detection. There's a caveat here though, since window.xxx form won't work ::

> 'ontouchstart' in window
true
> window.ontouchstart
null
  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket