我想知道,目前检测平板电脑和智能手机的最佳方法是什么?
插件,用户代理检测,触摸屏检测等。
由于
答案 0 :(得分:4)
查看此网址上排名最高的答案:
What is the best way to detect a mobile device in jQuery?
该线程的当前方法:
var isMobile = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry)/);
Jquery的:
$.browser.device = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));