how to identify if user agent is windows 8 tablet?

陌路散爱 提交于 2019-11-30 22:39:50

You can't identify if it is a tablet or not, but you can identify if it has touch or not. This is the IE user agent here:

Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; Touch)

The touch at the end is only present if touch is.

However, if you are just trying to identify touch capabilities, you should use feature detection rather than user agent sniffing.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!