javascript detect mobile device

来源:互联网 发布:淘宝套现 编辑:程序博客网 时间:2024/05/22 12:42
网址:wurfl.io

使用方法:
<script src="//wurfl.io/wurfl.js"></script>

WURFL.is_mobile                  判断是否是手机,返回true/false

WURFL.complete_device_name       获取手机具体型号


网址:http://hgoebl.github.io/mobile-detect.js/

使用方法:
<script src="mobile-detect.js"></script>

var info = new MobileDetect(window.navigator.userAgent);
info.os()                       获取手机操作系统
info.mobile()                   获取手机品牌(需要在js中写入判断)

info.phone()                    获取手机品牌(需要在js中写入判断)

info.is('iPhone')               判断是否是iphone设备

详细信息,可查询相应的网站



0 0