jQuery Check for tablet?
This question already has an answer here:
Try to see if perhaps this sheds a light on your question:
What is the best way to detect a mobile device in jQuery?
As the answer to that thread says, I'd suggest to rely on 'feature detection' rather than tablet vs non-tablet (as it may not be as straightforward as one may think) hence --> http://modernizr.com/
You can use navigator.userAgent and do a substring search to find out which tablet viewing your site. Here is a current list of tablet userAgent http://mojosunite.com/tablet-user-agent-strings
尝试将服务器中的useragent传递到页面中,以便JavaScript确切地知道正在报告哪个浏览器。
链接地址: http://www.djcxy.com/p/84048.html上一篇: HTML5:检测您是否在手机或电脑上使用JavaScript?
下一篇: jQuery检查平板电脑?