判断手机系统的类型
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"); }