[javascript] Detecting a mobile browser

_x000D_
_x000D_
return 'ontouchstart' in window && window.screen.availWidth < 768
_x000D_
_x000D_
_x000D_

How about this, it expands on answer above but also checks the screen size