码迷,mamicode.com
首页 > 移动开发 > 详细

判断手机系统的类型

时间:2018-10-30 14:45:39      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:ipo   boot   href   phone   iphone   agent   手机   tar   ipad   

https://www.cnblogs.com/boothsun/p/5463468.html

//android手机打开相机兼容性写法

if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { 
  //ios
} else if (/(Android)/i.test(navigator.userAgent)) { 
  //android
}

 

if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { 
$("#file_id").removeAttr("capture");
} else if (/(Android)/i.test(navigator.userAgent)) { 
$("#file_id").attr("capture","camera");
}

 

判断手机系统的类型

标签:ipo   boot   href   phone   iphone   agent   手机   tar   ipad   

原文地址:https://www.cnblogs.com/beimingbingpo/p/9876449.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!