标签:百度 one useragent 判断 style ios user nal nav
1 function getTerminalType() { 2 //获取navigator对象 3 var o = navigator.userAgent, 4 t = ""; 5 if (/\biPhone\b|\biPad\b/.test(o) && !/android/i.test(o)) { 6 t = "ios"; 7 } else if (/android/i.test(o)) { 8 t = "android"; 9 } else if (/windows/i.test(o)) { 10 t = "windows"; 11 } 12 console.log(t); 13 return t; 14 }
从百度js中提取
标签:百度 one useragent 判断 style ios user nal nav
原文地址:http://www.cnblogs.com/lmaster/p/6387157.html