判断手机系统的类型

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");
}

 

判断手机系统的类型

上一篇:.NET Core The configuration file 'appsettings.json' was not found and is not optional


下一篇:cordova 和 java ( JDK ) 和 android-studio (SDK)的初始安装和配置